java - Jena multiple rdfs:label -
i'm new jena , owl given ontology. can open protege 4.2 without problems when try open jena get: exception in thread "main" org.apache.jena.riot.riotexception: {e201} multiple children of property element
.
i have been looking bit in ontology , have noticed elements have more 1 label in language example:
<annotationassertion> <annotationproperty abbreviatediri="rdfs:label"/> <abbreviatediri>atc:a02bx02</abbreviatediri> <literal xml:lang="no" datatypeiri="&rdf;plainliteral">sukralfat</literal> </annotationassertion> <annotationassertion> <annotationproperty abbreviatediri="rdfs:label"/> <abbreviatediri>atc:a02bx02</abbreviatediri> <literal xml:lang="no" datatypeiri="&rdf;plainliteral">antepsin</literal> </annotationassertion> <annotationassertion> <annotationproperty abbreviatediri="rdfs:label"/> <abbreviatediri>atc:a02bx02</abbreviatediri> <literal datatypeiri="&xsd;string">sucralfate</literal> </annotationassertion> <annotationassertion> <annotationproperty abbreviatediri="rdfs:label"/> <abbreviatediri>atc:a02bx02</abbreviatediri> <literal xml:lang="no" datatypeiri="&rdf;plainliteral">sukralfat</literal> </annotationassertion>
could cause problem? code use works other ontologies think comes ontology. know cause exception?
edit
so got down minimized case , still same error:
<?xml version="1.0"?> <!doctype ontology [ <!entity xsd "http://www.w3.org/2001/xmlschema#" > <!entity xml "http://www.w3.org/xml/1998/namespace" > <!entity rdfs "http://www.w3.org/2000/01/rdf-schema#" > <!entity rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > ]> <ontology xmlns="http://www.w3.org/2002/07/owl#" xml:base="http://www.ebi.ac.uk/rebholz-srv/atc/public/ontologies/atc.owl" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/xmlschema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xml="http://www.w3.org/xml/1998/namespace" ontologyiri="http://www.ebi.ac.uk/rebholz-srv/atc/public/ontologies/atc.owl"> <prefix name="" iri="http://www.ebi.ac.uk/rebholz-srv/atc/public/ontologies/atc.owl#"/> <prefix name="atc" iri="http://www.legemiddelverket.no/legemiddelsoek/sider/default.aspx#"/> <prefix name="owl" iri="http://www.w3.org/2002/07/owl#"/> <prefix name="rdf" iri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> <prefix name="xml" iri="http://www.w3.org/xml/1998/namespace"/> <prefix name="xsd" iri="http://www.w3.org/2001/xmlschema#"/> <prefix name="rdfs" iri="http://www.w3.org/2000/01/rdf-schema#"/> <declaration> <class abbreviatediri="atc:j"/> </declaration> <annotationassertion> <annotationproperty abbreviatediri="rdfs:label"/> <abbreviatediri>atc:j</abbreviatediri> <literal datatypeiri="&xsd;string">antiinfectives systemic use</literal> </annotationassertion> </ontology>
here java code:
inputstream in = filemanager.get().open(filename); if (in == null) { throw new illegalargumentexception("file: " + filename + " not found"); } model = modelfactory.createontologymodel(ontmodelspec.owl_mem); model.read(in, null); try { in.close(); } catch (ioexception e) { system.err.println("couldn't close inputstream"); }
does help? don't have idea anymore...
that's owl2 xml formatted file. jena does't support format, support owl in rdf/xml.
in other words it's expecting wrong flavour of xml , getting confused.
try saving in format.
Comments
Post a Comment