Ignoring the wanrings which are just warning (no base in force so relative URIs not resolved: use "-b" to set the base)

this is RDF/XML striped syntax:

<foaf:Person rdf:ID="me">         class (and bnode id)
  <PubKey rdf:nodeID="KeyA">      so this is a property
   <foaf:name>key A</foaf:name>   has to be a class ... but isn't
  </PubKey>
 </foaf:Person>

I don't think you can have both rdf:nodeID on a property and also have content. But as the content suggests a property, there is striping misalignment.

        Andy


On 06/06/13 14:41, Michael Brunnbauer wrote:

hi all

is the NullPointerException expected behaviour ?

chianti:~/apache-jena-2.10.1$ cat test.rdf
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
  xmlns:foaf="http://xmlns.com/foaf/0.1/";>
  <foaf:Person rdf:ID="me">
   <PubKey rdf:nodeID="KeyA">
    <foaf:name>key A</foaf:name>
   </PubKey>
  </foaf:Person>
</rdf:RDF>
chianti:~/apache-jena-2.10.1$ ./bin/rdfparse test.rdf
<file:///home/java/apache-jena-2.10.1/test.rdf#me> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
Warning: file:///home/java/apache-jena-2.10.1/test.rdf(line 5 column 29): 
{W104} Unqualified property elements are not allowed. Treated as a relative URI.
Warning: file:///home/java/apache-jena-2.10.1/test.rdf(line 5 column 29): {W136} 
Relative URIs are not permitted in RDF: specifically <PubKey>
<file:///home/java/apache-jena-2.10.1/test.rdf#me> <PubKey> _:jUKeyA .
Error: file:///home/java/apache-jena-2.10.1/test.rdf(line 6 column 4): {E201} 
The attributes on this property element, are not permitted with any content; 
expecting end element tag.
Error: file:///home/java/apache-jena-2.10.1/test.rdf(line 6 column 15): {E201} XML 
element <foaf:name> inside an empty property element, whose attributes prohibit 
any content.
Error: file:///home/java/apache-jena-2.10.1/test.rdf(line 6 column 20): {E201} 
The attributes on this property element, are not permitted with any content; 
expecting end element tag.
Exception in thread "main" java.lang.NullPointerException
        at 
com.hp.hpl.jena.rdf.arp.impl.XMLHandler.endElement(XMLHandler.java:133)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
Source)
        at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown 
Source)
        at org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at 
com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:151)
        at com.hp.hpl.jena.rdf.arp.ARP.load(ARP.java:119)
        at com.hp.hpl.jena.rdf.arp.NTriple.process(NTriple.java:431)
        at com.hp.hpl.jena.rdf.arp.NTriple.process(NTriple.java:424)
        at com.hp.hpl.jena.rdf.arp.NTriple.mainEh(NTriple.java:139)
        at com.hp.hpl.jena.rdf.arp.NTriple.main(NTriple.java:97)
        at jena.rdfparse.main(rdfparse.java:89)

Regards,

Michael Brunnbauer


Reply via email to