# One note from the opening of Beethoven's Bagatelle in A minor, WoO 59: the D sharp of the
# E - D sharp figure. The symbolic note carries its pitch, duration, dynamic, accidental and
# position in the score, and each of those is realised by something measurable in a performance.

@prefix musicalobject: <https://purl.org/andreapoltronieri/musicalobject/> .
@prefix notepattern: <https://purl.org/andreapoltronieri/notepattern/> .
@prefix scorepart: <https://purl.org/andreapoltronieri/scorepart/> .
@prefix ex: <https://w3id.org/ontoboard/example/notepattern#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:DSharpInTheOpeningFigure a owl:NamedIndividual , notepattern:SymbolicNote ;
    rdfs:label "the D sharp of the opening E - D sharp figure" ;
    notepattern:belongsToSection ex:OpeningRondoSection ;
    notepattern:hasAccidental ex:TheSharpSign ;
    notepattern:hasNoteDuration ex:SemiquaverDuration ;
    notepattern:hasNoteDynamic ex:PianissimoDynamic ;
    notepattern:hasNotePitch ex:DSharp5Pitch ;
    notepattern:hasPosition ex:SecondSemiquaverOfTheOpeningBar ;
    notepattern:hasRealisation ex:DSharpAsPlayed .

ex:OpeningRondoSection a owl:NamedIndividual , scorepart:Section ;
    rdfs:label "the opening A minor section of the rondo" .

ex:TheSharpSign a owl:NamedIndividual , notepattern:Sharp ;
    rdfs:label "the sharp written in front of the D" .

ex:DSharp5Pitch a owl:NamedIndividual , notepattern:NotePitch ;
    rdfs:label "D sharp 5, a semitone above D in the fifth octave" ;
    notepattern:hasMidiPitch "75"^^xsd:int ;
    notepattern:isDefinedByOctave "5"^^xsd:int .

ex:SemiquaverDuration a owl:NamedIndividual , notepattern:NoteDuration ;
    rdfs:label "a semiquaver, one sixth of a 3/8 bar" .

ex:PianissimoDynamic a owl:NamedIndividual , notepattern:NoteDynamic ;
    rdfs:label "pianissimo, as the opening is marked" ;
    notepattern:hasLiteralDynamic "pianissimo" ;
    notepattern:hasMidiVelocity "32"^^xsd:int .

ex:SecondSemiquaverOfTheOpeningBar a owl:NamedIndividual , notepattern:Position ;
    rdfs:label "the second semiquaver of the opening bar" ;
    <https://purl.org/andreapoltronieri/notepattern#hasPositionInMeasure> "0.5"^^xsd:float ;
    notepattern:hasMeasure "1"^^xsd:int .

ex:DSharpAsPlayed a owl:NamedIndividual , musicalobject:MusicalObject ;
    rdfs:label "the D sharp as it sounds in the recorded performance" .

ex:MeasuredFundamental a owl:NamedIndividual , musicalobject:Frequency ;
    rdfs:label "622.25 Hz, the fundamental measured in the recording" ;
    notepattern:hasFrequencyAbstraction ex:DSharp5Pitch .

ex:PlayedDuration a owl:NamedIndividual , musicalobject:MusicalObjectDuration ;
    rdfs:label "0.12 s, how long the note was actually held" ;
    notepattern:hasDurationAbstraction ex:SemiquaverDuration .

ex:MeasuredAttackIntensity a owl:NamedIndividual , musicalobject:SoundIntensity ;
    rdfs:label "-28 dBFS, the intensity measured at the attack" ;
    notepattern:hasDynamicAbstraction ex:PianissimoDynamic .

# Only one direction of each inverse pair is asserted: belongsToFragment/groupsNoteEvent, belongsToSection/containsNoteEvent, belongsToVoice/containsNoteEvent, hasAccidental/isAccidentalOf, hasDurationAbstraction/isRealisedAsDuration, hasDynamicAbstraction/isRealisedAsIntensity, hasFrequencyAbstraction/isRealisedAsFrequency, hasNoteDuration/isDurationOfNote, hasNoteDynamic/isDynamicOf, hasNotePitch/isPitchOf, hasPosition/isPositionOf, hasRealisation/isRealisationOf. A reasoner adds the other.
