How to read owl ontology file: import to JENA?

I have an owl file that imports some other ontologies from other owl files. I tried to use the JENA API Documentation to solve this problem but was unable to succeed. What am I missing?

The codes I used above:

e-GovSecAOnto.owl imports:

<owl:Ontology rdf:about="">
    <owl:imports rdf:resource="http://www.ida.liu.se/~iislab/projects/secont/Security.owl"/>
    <owl:imports rdf:resource="http://www.unifiedcloud.org/2009/2/26/uci.owl"/>
    <owl:imports rdf:resource="http://wwwsemanticweb.org/ontologies/Portaria141.owl"/>
</owl:Ontology> 

      

ONT-policy.rdf:

    <?xml version='1.0'?>

<!DOCTYPE rdf:RDF [
    <!ENTITY jena    'http://jena.hpl.hp.com/schemas/'>

    <!ENTITY rdf     'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
    <!ENTITY rdfs    'http://www.w3.org/2000/01/rdf-schema#'>
    <!ENTITY xsd     'http://www.w3.org/2001/XMLSchema#'>
    <!ENTITY base    '&jena;2003/03/ont-manager'>
    <!ENTITY ont     '&base;#'>
]>

<rdf:RDF
  xmlns:rdf ="&rdf;"
  xmlns:rdfs="&rdfs;"
  xmlns     ="&ont;"
  xml:base  ="&base;"
>

<DocumentManagerPolicy>
    <processImports rdf:datatype="&xsd;boolean">true</processImports>
    <cacheModels    rdf:datatype="&xsd;boolean">true</cacheModels>
</DocumentManagerPolicy>

<OntologySpec>
    <altURL rdf:resource="file:///C:/Users/usuario/Documents/Visual Studio 2013/WebSites/FrameworkBeta/Repository/Ontologies/Portaria141/Portaria141_V1.owl"/>
    <language rdf:resource="http://www.w3.org/2002/07/owl"/>
    <publicURI rdf:resource="http://wwwsemanticweb.org/ontologies/Portaria141.owl"/>
</OntologySpec>

<OntologySpec>
    <altURL rdf:resource="file:///C:/Users/usuario/Documents/Visual Studio 2013/WebSites/FrameworkBeta/Repository/Ontologies/CloudComputing/uci.owl"/>
    <language rdf:resource="http://www.w3.org/2002/07/owl"/>
    <publicURI rdf:resource="http://www.unifiedcloud.org/2009/2/26/uci.owl"/>
</OntologySpec>

</rdf:RDF>

      

ReadOntology ():

OntDocumentManager dm = new OntDocumentManager(dmFileName);
OntModelSpec modelSpec = new OntModelSpec( OntModelSpec.RDFS_MEM );
modelSpec.setDocumentManager(dm);
OntModel m = ModelFactory.createOntologyModel(modelSpec);

m.read(FileManager.get().open(@"C:\Users\usuario\Documents\Visual Studio 2013\WebSites\FrameworkBeta\Repository\Ontologies\e-GovSecAOnto\e-GovSecAOnto.owl"), NS);

      

+1


source to share





All Articles