annotate feature-description-example.n3 @ 168:3e30dbb68ca2 jams

Write time or start/end based simply on whether the feature has them or not, let's not get clever
author Chris Cannam
date Wed, 15 Oct 2014 15:20:16 +0100
parents 581b1b150a4d
children
rev   line source
Chris@0 1
Chris@0 2 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
Chris@0 3 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Chris@0 4 @prefix dc: <http://purl.org/dc/elements/1.1/> .
Chris@0 5 @prefix mo: <http://purl.org/ontology/mo/> .
Chris@0 6 @prefix af: <http://purl.org/ontology/af/> .
Chris@0 7 @prefix event: <http://purl.org/NET/c4dm/event.owl#> .
Chris@0 8 @prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .
Chris@0 9 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Chris@0 10 @prefix : <#> .
Chris@0 11
Chris@0 12
Chris@0 13 # Describe the signal we're annotating, and associate it with a
Chris@0 14 # timeline (the timeline is named as :base_timeline but never given
Chris@0 15 # any attributes in this document). Any feature that is associated
Chris@0 16 # with the same timeline will be taken as derived from this signal.
Chris@0 17
Chris@0 18 :audio_signal a mo:Signal ;
Chris@0 19 mo:available_as <file:///path/to/myfile.wav> ;
Chris@0 20 mo:time :signal_interval .
Chris@0 21
Chris@0 22 :signal_interval a tl:Interval ;
Chris@0 23 tl:onTimeLine :base_timeline ;
Chris@0 24 tl:beginsAt "PT0"^^xsd:duration .
Chris@0 25
Chris@0 26
Chris@0 27 # A sparse feature event.
Chris@0 28
Chris@0 29 :event0 a af:Onset ;
Chris@0 30 event:time :time0 .
Chris@0 31
Chris@0 32 :time0 a tl:Instant ;
Chris@0 33 tl:onTimeLine :base_timeline ;
Chris@0 34 tl:at "PT0.185759637S"^^xsd:duration .
Chris@0 35
Chris@0 36 # Alternatively we could write that with a blank node.
Chris@0 37
Chris@0 38 :event1 a af:Onset ;
Chris@0 39 event:time [
Chris@0 40 a tl:Instant ;
Chris@0 41 tl:onTimeLine :base_timeline ;
Chris@0 42 tl:at "PT0.510839002S"^^xsd:duration ;
Chris@0 43 ] .
Chris@0 44
Chris@0 45
Chris@0 46 # For a dense feature, we need an appropriately sampled, windowed timeline.
Chris@0 47
Chris@0 48 :feature_timeline a tl:DiscreteTimeLine .
Chris@0 49
Chris@0 50 :feature_timeline_map a tl:UniformSamplingWindowingMap ;
Chris@0 51 tl:rangeTimeLine :feature_timeline ;
Chris@0 52 tl:domainTimeLine :base_timeline ;
Chris@0 53 tl:sampleRate "44100"^^xsd:int ;
Chris@0 54 tl:windowLength "1024"^^xsd:int ;
Chris@0 55 tl:hopSize "512"^^xsd:int .
Chris@0 56
Chris@0 57
Chris@0 58 # ... and an interval, defined in terms of hops (the discrete steps of
Chris@0 59 # the windowed timeline).
Chris@0 60
Chris@0 61 :feature_interval a tl:Interval ;
Chris@0 62 tl:onTimeLine :feature_timeline ;
Chris@0 63 tl:beginsAt "0"^^xsd:int ;
Chris@0 64 tl:duration "5634"^^xsd:int .
Chris@0 65
Chris@0 66
Chris@0 67 # Then our feature is a signal that is on the interval we just
Chris@0 68 # described. We associate it explicitly with the original audio
Chris@0 69 # signal, although presumably we could leave the association implicit,
Chris@0 70 # to be derived from the relationships between timelines, just as it
Chris@0 71 # is for the sparse features above.
Chris@0 72
Chris@0 73 :audio_signal af:signal_feature :feature1 .
Chris@0 74
Chris@0 75 :feature_signal_type rdfs:subClassOf af:DetectionFunction ;
Chris@0 76 dc:title "Detection Function from Simple Percussion Onset Detector" .
Chris@0 77
Chris@0 78 :feature1 a :feature_signal_type ;
Chris@0 79 mo:time :feature_interval ;
Chris@0 80 af:dimensions "12 12345" ;
Chris@0 81 af:value "0 0 0 0 0 0 0 1 2 3 1 24 236 123213 (etc)" .
Chris@0 82