私は映画のオントロジーを持っており、OWL-API を使用しており、いくつかの個人を追加しています。私が定義したいくつかの注釈を追加したいと思います。このリンクで個人にラベルを追加する方法をここで見つけました[ OWLAPI経由でOWLIndividualにrdfs:labelを追加する方法は?
しかし、私は rdfs:label の代わりに独自の定義済み注釈を追加したいと考えています。たとえば、 rdfs:Movie_Name を追加したいと考えています。期待される結果は次のとおりです。
<!-- http://www.daml.org/2003/01/movienight/movienight#Fury -->
<owl:NamedIndividual rdf:about="http://www.daml.org/2003/01/movienight/movienight#Fury">
<rdf:type rdf:resource="http://www.daml.org/2003/01/movienight/movienight/Movies_Genre#Action"/>
<rdf:type rdf:resource="http://www.daml.org/2003/01/movienight/movienight/Movies_Genre#Drama"/>
<rdfs:label>April, 1945. As the Allies make their final push in the European Theatre, a battle-hardened army sergeant named Wardaddy commands a Sherman tank and his five-man crew on a deadly mission behind enemy lines. Out-numbered, out-gunned, and with a rookie soldier thrust into their platoon, Wardaddy and his men face overwhelming odds in their heroic attempts to strike at the heart of Nazi Germany.</rdfs:label>
<rdfs:Movie_Name>Fury</rdfs:Movie_Name>
<rdfs:Directed_By> David Ayer</rdfs:Directed_By>
<rdfs:Year_of_production>2014</rdfs:Year_of_production>
<rdfs:Stars> Brad Pitt, Shia LaBeouf, Logan Lerman</rdfs:Stars>
<rdfs:Country>USA</rdfs:Country>
</owl:NamedIndividual>
上記のリンクからコピーしたコードは次のとおりです。
OWLAnnotation Movie_Name =
factory.getOWLAnnotation(
factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), lbl);
OWLAxiom axiomAA = factory.getOWLAnnotationAssertionAxiom(Cast.asOWLNamedIndividual().getIRI(), label);
manager.applyChange(new AddAxiom(ontology, axiom));
これに関するヘルプは大歓迎です。
ありがとう