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] Error while parsing ontology created in Protege4 with OWLAPI

jwa at student.agh.edu.pl jwa at student.agh.edu.pl
Thu Aug 27 10:20:33 PDT 2009


One more,

I have created sample ontology in Protege 4, and sample code of loading
that ontology in my program. I generates error.

String strPhysicalURIofOntology =
"http://student.agh.edu.pl/~jwa/owl/Shapes.owl";

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
URI uriOntology = URI.create(strPhysicalURIofOntology);

try {
	manager.setSilentMissingImportsHandling(true);
	manager.loadOntology(uriOntology);  //error
} catch (OWLOntologyCreationException ex) {
	System.out.print(ex.getMessage());
}

Thaks in advance

> Hello
>
> Thank You very much for checking that.
>
> I have also no problem with the ontology when I'm using Protege 4 (113).
> The OWLAPI is causing problems in my simple program.
>
> I' using owlapi-2.2.0.jar from http://maven.topazproject.org/maven2, I'm
> using maven and I've choosen the 2.2.0 version to be automatically
> downloaded. In attachement is screen from dependencies names and versions
> which I've used.
>
> Take care.
>
>> Hi jwa,
>>
>> ok, so your points 1 and 2 show that I was wrong with my advise to add
>> one more slash behind "file:/" on Windows, sorry.
>>
>> I've tried to open your ontology, whose link you sent me privately, in
>> Protégé 4 build 113 and didn't get any errors. Since your problems
>> occur with the OWL API, I suspect you're using a different, probably
>> older, version of the OWL API than the one bundled with the Protégé
>> version you used to create the ontology.
>>
>> Can you please post the build number for Protégé and the OWL API
>> version number?
>>
>> Cheers
>>
>> Thomas
>>
>> On 25 Aug 2009, at 23:13, jwa at student.agh.edu.pl wrote:
>>
>>> 1. first execution:
>>>
>>> OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
>>> URI physicalURI = URI.create("file://C:/Users/jwa/Desktop/myont.owl");
>>> OWLOntology ontology =
>>> manager.loadOntologyFromPhysicalURI(physicalURI);
>>>
>>> result:
>>>
>>> The ontology could not be created: C
>>>
>>> 2. second execution
>>>
>>> OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
>>> URI physicalURI = URI.create("file:/C:/Users/jwa/Desktop/myont.owl");
>>> OWLOntology ontology =
>>> manager.loadOntologyFromPhysicalURI(physicalURI);
>>>
>>> result:
>>>
>>> The ontology could not be created: Problem parsing
>>> file:/C:/Users/jwa/Desktop/myont.owl
>>> Could not parse ontology.  Either a suitable parser could not be
>>> found, or
>>> parsing failed.  See parser logs below for explanation.
>>> The following parsers were tried.
>>> 1) org.coode.owl.rdfxml.parser.RDFXMLParser
>>> 2) org.coode.owl.owlxmlparser.OWLXMLParser
>>> 3) org.coode.owl.functionalparser.OWLFunctionalSyntaxOWLParser
>>> 4) uk.ac.manchester.cs.owl.turtle.parser.TurtleOntologyParser
>>> 5) org.coode.manchesterowlsyntax.ManchesterOWLSyntaxOntologyParser
>>> 6) org.coode.obo.parser.OWLOBOParser
>>> 7) de.uulm.ecs.ai.owl.krssparser.KRSS2OWLParser
>>>
>>>
>>> Detailed logs:
>>> --------------------------------------------------------------------------------
>>> Parser class: org.coode.owl.rdfxml.parser.RDFXMLParser
>>> org.coode.owl.rdfxml.parser.OWLRDFParserException: Unable to
>>> determine the
>>> type of restriction!
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class: org.coode.owl.owlxmlparser.OWLXMLParser
>>> (Current element RDF
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class:
>>> org.coode.owl.functionalparser.OWLFunctionalSyntaxOWLParser
>>> org.coode.owl.functionalparser.ParseException: Encountered "<" at
>>> line 1,
>>> column 1.
>>> Was expecting one of:
>>>    "Ontology" ...
>>>    "Namespace" ...
>>>     (Line 0)
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class:
>>> uk.ac.manchester.cs.owl.turtle.parser.TurtleOntologyParser
>>> java.net.URISyntaxException: Illegal character in query at index 4: ?
>>> xml
>>> version="1.0"?
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class:
>>> org.coode.manchesterowlsyntax.ManchesterOWLSyntaxOntologyParser
>>> org.semanticweb.owl.expression.ParserException: Encountered <?xml at
>>> line
>>> 0 column 0. Expected one of:
>>> 	Individual:
>>> 	Class:
>>> 	ObjectProperty:
>>> 	Imports:
>>> 	DataProperty:
>>> 	ValuePartition:
>>>
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class: org.coode.obo.parser.OWLOBOParser
>>> org.coode.obo.parser.ParseException: Encountered "<!DOCTYPE rdf" at
>>> line
>>> 4, column 1.
>>> Was expecting:
>>>    "\n" ...
>>>
>>>
>>> --------------------------------------------------------------------------------
>>> Parser class: de.uulm.ecs.ai.owl.krssparser.KRSS2OWLParser
>>> de.uulm.ecs.ai.owl.krssparser.ParseException: Encountered "<?xml
>>> version=\"1.0\"?>" at line 1, column 1.
>>> Was expecting one of:
>>>    <EOF>
>>>    "(" ...
>>>    "end-tbox" ...
>>>    "end-abox" ...
>>>
>>>> This seems to be a problem with the file name:
>>>>
>>>>      file:/C:/Users/jwa/myont.owl
>>>>
>>>> I think under Windows it must be file:// plus the path and file name.
>>>> So if you try to change the parameter for
>>>> loadOntologyFromPhysicalURI(..), you might be able to solve the
>>>> problem.
>>>>
>>>> Otherwise, please post the complete line that contains the call to
>>>> loadOntologyFromPhysicalURI.
>>>>
>>>> Cheers
>>>>
>>>> Thomas
>>>>
>>>> On 25 Aug 2009, at 20:24, jwa at student.agh.edu.pl wrote:
>>>>
>>>>> Hello
>>>>>
>>>>> For example: I saved my ontology in Manchester OWL syntax format,
>>>>> and
>>>>> while invoking loadOntologyFromPhysicalURI(..), the following error
>>>>> occures:
>>>>>
>>>>> ##############
>>>>> The ontology could not be created: Problem parsing
>>>>> file:/C:/Users/jwa/myont.owl
>>>>> Could not parse ontology.  Either a suitable parser could not be
>>>>> found, or
>>>>> parsing failed.
>>>>> ...
>>>>> --------------------------------------------------------------------------
>>>>> Parser class:
>>>>> org.coode.manchesterowlsyntax.ManchesterOWLSyntaxOntologyParser
>>>>> org.semanticweb.owl.expression.ParserException: Encountered
>>>>> <http://www.w3.org/2006/12/owl2-xml#> at line 0 column 19. Expected
>>>>> one
>>>>> of:
>>>>> 	=
>>>>>
>>>>> --------------------------------------------------------------------------
>>>>> ...
>>>>> ##############
>>>>>
>>>>> Thanks in advice
>>>>>
>>>>>>
>>>>>> First, Protege 4 loads and saves ontologies using the owlapi.  So
>>>>>> ontologies that you can load in Protege 4 certainly will load in
>>>>>> the
>>>>>> owl api.
>>>>>>
>>>>>> You need to provide some information about the error that you are
>>>>>> seeing.  My first guess - based only on information that you have
>>>>>> provided - is that you are having trouble with imports resolution.
>>>>>> Protege 4 handles problems with an import gracefully but if you
>>>>>> simply
>>>>>> load an ontology with loadOntologyFromPhysicalURI an import that
>>>>>> can't
>>>>>> be found it will fail:
>>>>>>
>>>>>>   Parser: RDFXMLParser
>>>>>>   org.semanticweb.owl.io.OWLOntologyCreationIOException:
>>>>>> protege.stanford.edu
>>>>>>
>>>>>> If this is your problem then it can be easily fixed.
>>>>>>
>>>>>> -Timothy
>>>>>>
>>>>>>
>>>>>> On Aug 24, 2009, at 5:37 PM, jwa at student.agh.edu.pl wrote:
>>>>>>
>>>>>>> Hello
>>>>>>>
>>>>>>> Is there any way to load an ontology, created in Protege 4, with
>>>>>>> OWLAPI
>>>>>>> (http://owlapi.sourceforge.net/) ?
>>>>>>> The standard ontology from example
>>>>>>> ("http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.owl") of
>>>>>>> course
>>>>>>> loads perfectly, but if I try to create another, simple ontology,
>>>>>>> loading
>>>>>>> fails on function loadOntologyFromPhysicalURI(..). I have tried to
>>>>>>> load ontology in all output formats, which Protege provides, and
>>>>>>> all
>>>>>>> have
>>>>>>> failed. (Protege didn't show any errors in his ontology, and read
>>>>>>> and
>>>>>>> write the ontology correttly).
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> protege-owl mailing list
>>>>>>> protege-owl at lists.stanford.edu
>>>>>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>>>>>
>>>>>>> Instructions for unsubscribing:
>>>>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>>>>>
>>>>>> _______________________________________________
>>>>>> protege-owl mailing list
>>>>>> protege-owl at lists.stanford.edu
>>>>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>>>>
>>>>>> Instructions for unsubscribing:
>>>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> protege-owl mailing list
>>>>> protege-owl at lists.stanford.edu
>>>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>>>
>>>>> Instructions for unsubscribing:
>>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>>>
>>>> +
>>>> ----------------------------------------------------------------------+
>>>> |  Dr Thomas Schneider                    schneider (at)
>>>> cs.man.ac.uk  |
>>>> |  School of Computer Science       http://www.cs.man.ac.uk/
>>>> ~schneidt  |
>>>> |  Kilburn Building, Room 2.114                 phone +44 161
>>>> 2756136  |
>>>> |  University of
>>>> Manchester                                            |
>>>> |  Oxford Road                                             _///
>>>> _       |
>>>> |  Manchester M13 9PL
>>>> (o~o)       |
>>>> +-----------------------------------------------------oOOO--(_)--
>>>> OOOo--+
>>>>
>>>> Golant (adj.)
>>>>   Blank, sly and faintly embarrassed. Pertaining to the expression
>>>> seen
>>>>   on the face of someone who has clearly forgotten your name.
>>>>
>>>>                   Douglas Adams, John Lloyd: The Deeper Meaning of
>>>> Liff
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> protege-owl mailing list
>>>> protege-owl at lists.stanford.edu
>>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>>
>>>> Instructions for unsubscribing:
>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>>>
>>>
>>>
>>> _______________________________________________
>>> protege-owl mailing list
>>> protege-owl at lists.stanford.edu
>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>
>>> Instructions for unsubscribing:
>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>
>> +----------------------------------------------------------------------+
>> |  Dr Thomas Schneider                    schneider (at) cs.man.ac.uk  |
>> |  School of Computer Science       http://www.cs.man.ac.uk/~schneidt  |
>> |  Kilburn Building, Room 2.114                 phone +44 161 2756136  |
>> |  University of Manchester                                            |
>> |  Oxford Road                                             _///_       |
>> |  Manchester M13 9PL                                      (o~o)       |
>> +-----------------------------------------------------oOOO--(_)--OOOo--+
>>
>> Golant (adj.)
>>    Blank, sly and faintly embarrassed. Pertaining to the expression seen
>>    on the face of someone who has clearly forgotten your name.
>>
>>                    Douglas Adams, John Lloyd: The Deeper Meaning of Liff
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing:
>> http://protege.stanford.edu/doc/faq.html#01a.03
>>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>





More information about the protege-owl mailing list