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-discussion] a simple questions about owl programming

tingyu li li.hh190 at gmail.com
Mon Nov 22 06:06:54 PST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101122/3c93562d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: familyCopy_changed.owl
Type: application/octet-stream
Size: 29942 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101122/3c93562d/attachment.owl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newversion.owl
Type: application/octet-stream
Size: 7493 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101122/3c93562d/attachment-0001.owl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PropertyValuee.java
Type: application/octet-stream
Size: 1476 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20101122/3c93562d/attachment.java>


More information about the protege-discussion mailing list