Search Mailing List Archives
[protege-discussion] a simple questions about owl programming
tingyu li
li.hh190 at gmail.com
Tue Nov 23 23:49:20 PST 2010
hi,
this three mails just refer one question, as I described in the last mail, "
Protege 3 can work with the ontology but the Manchester OWL finds a syntax
error". in the third mail from the end, I send the error "unknown protocol:
c", and I explained it in the second mail from the end, that because I
forget add prefix file:/// in the front of the path string. but the problem
still doesn't fix. and in order to avoid any encoding or any unknown or
unexpected error, I create a new rdf/xml files using protege 4.1 beta.and I
didn't do any change by editing the owl file with a text editor(I'm pretty
sure about that).
and I tried a lot of methods to test the files. as I send you the attachment
in the last three mails, I copy the parts of ontology newversion including
"rdf:resource" associated with an element type "rdfs:subClassOf" into
familyCopy_changed.owl, and it still can be loaded correctly. and the rest
part of this newversion.owl still doesn't work. and I think it must has
some encoding errors. So the last solutions I used is copy the whole text of
newversion.owl, and paste it into the familyCopy_changed.owl(delete existing
text to make a blank page), and it really works. although the newversion.owl
is created by protege 4.1 and I didn't find any differences about structures
between newversion.owl and familyCopy_changed.owl. that is weird.
and I also find that protege is not stable based on windows OS. sometimes,
the operations on protege can't be mapped on the owl files. for example: I
delete a property for individual using the interface, and when I open the
owl file using text editor, it's still here. and some other false operation
also can happen sometimes when a lot of classes and individuals included.
and I wonder what size for owl files can be beared by protege or owlapi.
Thanks.
by the way, the ontology newversion.owl and familyCopy_changed.owl can be
found in the last mail I send to you as an attachment.
2010/11/24 Timothy Redmond <tredmond at stanford.edu>
>
> I see you have some questions spanning a few days - I will go through them
> in reverse order.
>
>
> but it can't be processed by the codes PropertyValuee.java, as the same
> time family.owl can be. I'm so confused by this. does anybody give me a
> hint? And the error code is :
>
>
> The errors that you are reporting are syntax errors coming from the
> Manchester OWL api. Your first snippet of code is based on the Protege 3 OWL
> api. It is a bit surprising but not amazing that Protege 3 can work with
> the ontology but the Manchester OWL finds a syntax error. I believe that
> the Manchester OWL api is probably right - there is a problem with the
> ontology that it is trying to parse. In particular the rdf error is
> probably the right one:
>
>
> Parser: RDFXMLParser
> org.xml.sax.SAXParseException: The value of attribute "rdf:resource"
> associated with an element type "rdfs:subClassOf" must not contain the '<'
> character.
>
>
> If you send the ontology that the Manchester OWL api is trying to parse at
> this point I can give you more information.
>
> I am not sure but I am guessing that some of your problems come from
> editing an ontology with a text editor. We all do this but it is a
> dangerous practice.
>
> -Timothy
>
>
>
> On 11/22/2010 06:06 AM, tingyu li wrote:
>
>
> OK. Lst's forget the problems above, and I have simplified the questions. a
> new owl files (newversion.owl) has been created, and it can be processed by
> the codes below, and So does the familyCopy_changed.owl :
>
>
>> String uri = "file:///C://Users//Li//ontologies//newversion.owl";
>>
>>
>> OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);
>>
>> Collection classes = owlModel.getUserDefinedOWLNamedClasses();
>> //OWLNamedClass destinationClass =
>> owlModel.getOWLNamedClass("family");
>> for (Iterator it = classes.iterator(); it.hasNext();) {
>> OWLNamedClass cls = (OWLNamedClass) it.next();
>> Collection instances = cls.getInstances(false);
>> System.out.println("Class " + cls.getBrowserText() + " (" +
>> instances.size() + ")");
>> for (Iterator jt = instances.iterator(); jt.hasNext();) {
>> OWLIndividual individual = (OWLIndividual) jt.next();
>> System.out.println(" - " + individual.getBrowserText());
>> }
>> }
>>
>
> but it can't be processed by the codes PropertyValuee.java, as the same
> time family.owl can be. I'm so confused by this. does anybody give me a
> hint? And the error code is :
>
> detailed logs:
>>
>> --------------------------------------------------------------------------------
>> Parser: RDFXMLParser
>> org.xml.sax.SAXParseException: The value of attribute "rdf:resource"
>> associated with an element type "rdfs:subClassOf" must not contain the '<'
>> character.
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: OWLXMLParser
>> Attribute not found: IRI (Line 30)
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: OWLFunctionalSyntaxOWLParser
>> Encountered " <ERROR> "< "" at line 1, column 1.
>> Was expecting:
>> "Ontology" ...
>> (Line 0)
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: TurtleOntologyParser
>> uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered
>> "" at line 1, column 1.
>> Was expecting one of:
>>
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: OWLOBOParser
>> org.coode.owlapi.obo.parser.ParseException: Encountered "<!DOCTYPE rdf" at
>> line 4, column 1.
>> Was expecting:
>> "\n" ...
>> (Line 1)
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: KRSS2OWLParser
>> de.uulm.ecs.ai.owlapi.krssparser.ParseException: Encountered "<?xml
>> version=\"1.0\"?>" at line 1, column 1.
>> Was expecting:
>> <EOF>
>>
>>
>>
>> --------------------------------------------------------------------------------
>> Parser: ManchesterOWLSyntaxOntologyParser
>> Encountered '<?xml version="1.0"?>' at line 1 column 1. Expected either
>> 'Ontology:' or 'Prefix:' (Line 1)
>>
>>
>> at
>> uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:197)
>> at
>> uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:619)
>> at
>> uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:585)
>> at
>> uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:589)
>> at com.demo.application.PropertyValuee.main(PropertyValuee.java:26)
>>
>
>
>
>
> --
> Li
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.eduhttps://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>
--
Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101124/287b0763/attachment.html>
More information about the protege-discussion
mailing list