Step 3 – Extend the MICO metadata model (~40 minutes)  Step 3 – First round of bugfixing (a couple of days… or maybe weeks?) 

NOTE: Deleted text means that we did it during the first integration attempt with the old platform versions, due to the limitations of the previous API. Don’t try this at home!


The third step for integrating the AudioTrust+ extractors consisted of extending the MICO metadata model. We had few experience with RDF, and since we couldn’t come up with any reasonable solution we decided to only persist the xml annotation. We had few experience with RDF, but found annotation examples in the MICO metadata model – Terms ontology, which we took as a basis for our own case:

audiotrustplus-annotations

Creating a Body in Java that could work with Anno4J was even easier. We first defined a class for the AudioTrust+ terms ontology:

[code language=java”]public class ATPTERMS {
 
//ontology namespace
public final static String NS = “http://www.audiotrustplus-project.de/ns/atpterms/1.0/schema#”;
 
//annotation body for audio tampering detection
public final static String AUDIO_TAMPERING_DETECTION_BODY = NS + “AudioTamperingDetectionBody”;
 
//extractor that discovered the discontinuity
public final static String SOURCE_DETECTOR = NS + “SourceDetector”;
 
//threshold setup during the analysis, if present
public final static String DETECTION_THRESHOLD = NS + “DetectionThreshold”;
 
//score leading to the detection, if present
public final static String DETECTION_SCORE = NS + “DetectionScore”;
 
//feature that lead to the detection
public final static String INCONSISTENT_FEATURE = NS + “InconsistentFeature”;
 
}[/code]

Then, we relied on simple spring annotations to bind it to a usable interface:

[code language=java”]import org.openrdf.annotations.Iri;
import com.github.anno4j.model.Body;
 
//annotation body for audio tampering detection
@Iri(ATPTERMS.AUDIO_TAMPERING_DETECTION_BODY)
public interface AudioTamperingDetectionBody extends Body {
 
//extractor that discovered the discontinuity
@Iri(ATPTERMS.SOURCE_DETECTOR)
void setSourceDetector(String sourceDetector);
 
@Iri(ATPTERMS.SOURCE_DETECTOR)
String getSourceDetector();
 
//threshold setup during the analysis, if present
@Iri(ATPTERMS.DETECTION_THRESHOLD)
void setDetectionThreshold(Float threshold);
 
@Iri(ATPTERMS.DETECTION_THRESHOLD)
Float getDetectionThreshold();
 
//score leading to the detection, if present
@Iri(ATPTERMS.DETECTION_SCORE)
void setDetectionScore(Float score);
 
@Iri(ATPTERMS.DETECTION_SCORE)
Float getDetectionScore();
 
//feature that lead to the detection
@Iri(ATPTERMS.INCONSISTENT_FEATURE)
void setInconsistentFeature(String feature);
 
@Iri(ATPTERMS.INCONSISTENT_FEATURE)
String getInconsistentFeature();
 
}[/code]

With this preparation phase finished, we could finally move on to the real deal: Implementing the AudioTrust+ extractors!

mico-meets-audiotrustplus-logo

« 1, 2, 3, 4, 5, 6, 7 »