Note that there are some explanatory texts on larger screens.

plurals
  1. POJena multiple rdfs:label
    primarykey
    data
    text
    <p>I'm new to Jena and Owl I was given an ontology. I can open it with Protege 4.2 without any problems but when I try to open it with Jena I get: <code>Exception in thread "main" org.apache.jena.riot.RiotException: {E201} Multiple children of property element</code>.</p> <p>I have been looking a bit in my Ontology what it could be and I have noticed that some elements have more than one Label in a language for example:</p> <pre><code>&lt;AnnotationAssertion&gt; &lt;AnnotationProperty abbreviatedIRI="rdfs:label"/&gt; &lt;AbbreviatedIRI&gt;atc:A02BX02&lt;/AbbreviatedIRI&gt; &lt;Literal xml:lang="no" datatypeIRI="&amp;rdf;PlainLiteral"&gt;Sukralfat&lt;/Literal&gt; &lt;/AnnotationAssertion&gt; &lt;AnnotationAssertion&gt; &lt;AnnotationProperty abbreviatedIRI="rdfs:label"/&gt; &lt;AbbreviatedIRI&gt;atc:A02BX02&lt;/AbbreviatedIRI&gt; &lt;Literal xml:lang="no" datatypeIRI="&amp;rdf;PlainLiteral"&gt;antepsin&lt;/Literal&gt; &lt;/AnnotationAssertion&gt; &lt;AnnotationAssertion&gt; &lt;AnnotationProperty abbreviatedIRI="rdfs:label"/&gt; &lt;AbbreviatedIRI&gt;atc:A02BX02&lt;/AbbreviatedIRI&gt; &lt;Literal datatypeIRI="&amp;xsd;string"&gt;sucralfate&lt;/Literal&gt; &lt;/AnnotationAssertion&gt; &lt;AnnotationAssertion&gt; &lt;AnnotationProperty abbreviatedIRI="rdfs:label"/&gt; &lt;AbbreviatedIRI&gt;atc:A02BX02&lt;/AbbreviatedIRI&gt; &lt;Literal xml:lang="no" datatypeIRI="&amp;rdf;PlainLiteral"&gt;sukralfat&lt;/Literal&gt; &lt;/AnnotationAssertion&gt; </code></pre> <p>Could this cause the problem? All the code I use works with other ontologies so I think it really comes from this ontology. Do you know what could cause this exception?</p> <h2>Edit</h2> <p>So I got down to a minimized case and still get the same error:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!DOCTYPE Ontology [ &lt;!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" &gt; &lt;!ENTITY xml "http://www.w3.org/XML/1998/namespace" &gt; &lt;!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" &gt; &lt;!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" &gt; ]&gt; &lt;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"&gt; &lt;Prefix name="" IRI="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl#"/&gt; &lt;Prefix name="atc" IRI="http://www.legemiddelverket.no/Legemiddelsoek/Sider/Default.aspx#"/&gt; &lt;Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/&gt; &lt;Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/&gt; &lt;Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/&gt; &lt;Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/&gt; &lt;Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/&gt; &lt;Declaration&gt; &lt;Class abbreviatedIRI="atc:J"/&gt; &lt;/Declaration&gt; &lt;AnnotationAssertion&gt; &lt;AnnotationProperty abbreviatedIRI="rdfs:label"/&gt; &lt;AbbreviatedIRI&gt;atc:J&lt;/AbbreviatedIRI&gt; &lt;Literal datatypeIRI="&amp;xsd;string"&gt;ANTIINFECTIVES FOR SYSTEMIC USE&lt;/Literal&gt; &lt;/AnnotationAssertion&gt; &lt;/Ontology&gt; </code></pre> <p>Here is the java code:</p> <pre><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 the inputStream"); } </code></pre> <p>Does this help? I really don't have any idea anymore...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload