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-owl] Loading an ontology from a String

Ralf Weinand weinanr at cs.tu-berlin.de
Fri Jan 11 10:48:44 PST 2008


Hi,

I want to use the protege-owl API (3.4 b125) to load an ontology
which is not serialized in a file but is sent via e.g. a SOAP message.

However, when I try to create the JenaOWLModel via

    sourceOwlModel = ProtegeOWL.createJenaOWLModelFromInputStream(new
StringInputSource(sourceIndividual).getInputStream());

I get the following error:

SEVERE: An error occurred at parsing the OWL ontology

   http://dummy-ontologies.com/dummy.owl

   at line -1 and column -1.
   Jena parse error message: {E213} dummy-ontologies.com --
java.net.UnknownHostException: dummy-ontologies.com

To simulate that the ontology was send as a string, I did initialize the
variable via:

sourceIndividual =
"<?xml version=\"1.0\"?> <rdf:RDF  xmlns:rdf=\"
http://www.w3.org/1999/02/22-rdf-syntax-ns#\"  xmlns:owl=\"
http://www.w3.org/2002/07/owl#\"  xmlns:xsd=\"
http://www.w3.org/2001/XMLSchema#\"  xmlns:rdfs=\"
http://www.w3.org/2000/01/rdf-schema#\"  xmlns=\"
http://www.abc.de/test/sourceOntology.owl#\"  xml:base=\"
http://www.abc.de/test/sourceOntology.owl\">  <owl:Ontology rdf:about=\"\"/>
 <owl:Class rdf:ID=\"Address\">  <owl:equivalentClass>  <owl:Class>
 <owl:intersectionOf rdf:parseType=\"Collection\">  <owl:Restriction>
 <owl:onProperty>  <owl:FunctionalProperty rdf:ID=\"City\"/>
 </owl:onProperty>  <owl:cardinality rdf:datatype=\"
http://www.w3.org/2001/XMLSchema#int\"  >1</owl:cardinality>
 </owl:Restriction>  <owl:Restriction>  <owl:onProperty>
 <owl:FunctionalProperty rdf:ID=\"firstName\"/>  </owl:onProperty>
 <owl:cardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#int\"
 >1</owl:cardinality>  </owl:Restriction>  <owl:Restriction>
 <owl:onProperty>  <owl:FunctionalProperty rdf:ID=\"lastName\"/>
 </owl:onProperty>  <owl:cardinality rdf:datatype=\"
http://www.w3.org/2001/XMLSchema#int\"  >1</owl:cardinality>
 </owl:Restriction>  </owl:intersectionOf>  </owl:Class>
 </owl:equivalentClass>  </owl:Class>  <owl:FunctionalProperty
rdf:about=\"#firstName\">  <rdfs:range rdf:resource=\"
http://www.w3.org/2001/XMLSchema#string\"/>  <rdf:type rdf:resource=\"
http://www.w3.org/2002/07/owl#DatatypeProperty\"/>
 </owl:FunctionalProperty>  <owl:FunctionalProperty rdf:about=\"#lastName\">
 <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>
 <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#string\"/>
 </owl:FunctionalProperty>  <owl:FunctionalProperty rdf:about=\"#City\">
 <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#DatatypeProperty\"/>
 <rdfs:range rdf:resource=\"http://www.w3.org/2001/XMLSchema#string\"/>
 </owl:FunctionalProperty>  <Address rdf:ID=\"Address_1\">  <City
rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"  >Berlin</City>
 <lastName rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"
 >Smith</lastName>  <firstName rdf:datatype=\"
http://www.w3.org/2001/XMLSchema#string\"  >John</firstName>  </Address>
</rdf:RDF>";

I guess this is a repositoryManager-issue. Maybe someone can give me a hint
on how to handle such a case
where I don´t have a file/url to point at. Thanks a lot in advance!

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20080111/99272c6c/attachment.html>


More information about the protege-owl mailing list