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] Problem loading OWL ontology written in N-Triples

Jan Zemánek jan.zemanek at deri.org
Fri Aug 3 11:12:08 PDT 2007


Hi dear Protege-OWL fellows,

I am trying to load an OWL ontology written in N-Triples syntax from 
file using Protege-OWL API but I keep getting a parsing error.
The code I am using is as follows

JenaOWLModel jenaOwlModel = ProtegeOWL.createJenaOWLModel();
jenaOwlModel.load(new 
URI("file:/c://dev/protege/examples/linkedid/linkedid_v1_nt.rdf"), 
FileUtils.langNTriple);

The entire ontology looks like:

<http://linkedid.org/ontology/ontology.owl> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
<http://linkedid.org/ontology/ontology.owl#Person> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Class> .

And here is the stack trace I get:

WARNING: [Local Folder Repository] The specified file must be a 
directory. (C:\Documents and 
Settings\Jan\Dokumenty\Workspace\Playground\plugins\edu.stanford.smi.protegex.owl) 
-- LocalFolderRepository.update()
INFO: Loading triples
INFO: Start processing ontology: 
file:/c://dev/protege/examples/linkedid/linkedid_v1_nt.rdf Time: Fri Aug 
03 20:00:04 CEST 2007
SEVERE: An error occurred at parsing the OWL ontology

     file:/C:/dev/protege/examples/linkedid/linkedid_v1_nt.rdf

     at line 1 and column 7.
     Jena parse error message: Element or attribute do not match QName 
production: QName::=(NCName':')?NCName.  -- 
org.xml.sax.SAXParseException: Element or attribute do not match QName 
production: QName::=(NCName':')?NCName.
	at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanQName(Unknown Source)
	at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown 
Source)
	at 
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(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:106)
	at com.hp.hpl.jena.rdf.arp.ARP.load(ARP.java:143)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser$1.invokeARP(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at edu.stanford.smi.protegex.owl.jena.JenaOWLModel.load(Unknown Source)
	at TestJenaOwlModel.main(TestJenaOwlModel.java:27)

Exception in thread "main" java.lang.NullPointerException
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.createDefaultNamespace(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at 
edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown 
Source)
	at edu.stanford.smi.protegex.owl.jena.JenaOWLModel.load(Unknown Source)
	at TestJenaOwlModel.main(TestJenaOwlModel.java:27)

Can anyone give me a hand please?

Best regards,
Jan

-- 
Jan Zemánek
Digital Enterprise Research Institute
National University of Galway
Galway, Ireland

e: jan.zemanek at deri.org
h: http://www.deri.ie/about/team/member/jan_zemanek/



More information about the protege-owl mailing list