Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Dublin core annotation of OWL classes: howTo?

Fabrizio fabrizio.antonelli at telecomitalia.it
Fri Feb 23 08:27:35 PST 2007


>>>

Hi all,
I'm trying to add a dc annotation property to a class contained in a
JenaOWLModel, using the Protege API. I would like to obtain something like

-------------------------------------------------------------------------

<owl:Class rdf:ID="Idaho">
    <rdfs:subClassOf>
      <owl:Class rdf:about="United_States"/>
    </rdfs:subClassOf>
    <dc:identifier>375903</dc:identifier>
</owl:Class>

-------------------------------------------------------------------------

where "dc:identifier" contains a unique value for the class.

The JAVA code I thought could work is:
        
OWLModel dublinCoreModel = OwlProtegeIo.openOWLFile("dublincore.owl");

Iterator it;

Collection dcAnnotationProperties = dublinCoreModel.getOWLAnnotationProperties();

it = dcAnnotationProperties.iterator();

while (it.hasNext()) {
    dcAnnotation = (RDFProperty) it.next();
    if ((dcAnnotation.getName()).equals("identifier"))
       break;
}

idahoNamedClass.addPropertyValue(dcAnnotation, "375903");


Unfortunately it doesn't seem to work 'cause the result is:

-------------------------------------------------------------------------

<owl:Class rdf:ID="Idaho">
    <rdfs:subClassOf>
      <owl:Class rdf:about="United_States"/>
    </rdfs:subClassOf>
    <dc:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >375903</dc:identifier>
  </owl:Class>

-------------------------------------------------------------------------

Another problem is that after having saved the model in a owl file, when I
reopen it I would like to access the annotation property "dc:identifier" and its
value but neither:

Object annotationValue = idahoNamedClass.getPropertyValue(dcAnnotation);

nor:

Collection annotationProperties = idahoNamedClass.getRDFProperties();

seem to help me, cause the property isn't accessible/visible using these methods.
Has someone had the same problem? Is there an easier way to insert dc
annotations in a OWLModel?

Thanks.
Fabrizio






More information about the protege-discussion mailing list