SKOS-API OWL exception

153 views
Skip to first unread message

Roberto Morelato

unread,
May 17, 2013, 1:57:28 AM5/17/13
to skos...@googlegroups.com

I'm trying to use the skosapi latest version (http://skosapi.sourceforge.net/), but it seems there are some conflicts with OWL 3.4.3 package, the SKOSManager default constructor looks for the Class: org/semanticweb/owl/model/OWLOntologyStorageException , but in the latest version of OWL the dependency is found into another path.
 
so the only result that I get is following:

Exception in thread "main" java.lang.NoClassDefFoundError: org/semanticweb/owl/model/OWLOntologyStorageException
 at readXMLclasses.Example1.main(Example1.java:58)
Caused by: java.lang.ClassNotFoundException: org.semanticweb.owl.model.OWLOntologyStorageException
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 

Is there any solution?


I tryed to get some old versions like 2.x.x but it seems they aren't available anymore

Guillermo Esteban

unread,
May 17, 2013, 12:28:22 PM5/17/13
to skos...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "skos-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skos-dev+u...@googlegroups.com.
To post to this group, send email to skos...@googlegroups.com.
Visit this group at http://groups.google.com/group/skos-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Roberto Morelato

unread,
May 21, 2013, 2:48:33 AM5/21/13
to skos...@googlegroups.com
Hi thank you for you quick answer but still does not solve my trouble.
I'm trying to write a simple basic Java class that reads an OWL file as input and parses SKOS elements like following:
 
<rdf:RDF xmlns="http://www.semanticweb.org/roberto/ontologies/2013/4/untitled-ontology-2#"
    <owl:Class rdf:about="http://www.semanticweb.org/roberto/ontologies/2013/4/untitled-ontology-8#tid/2848">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/roberto/ontologies/2013/4/untitled-ontology-8#tid/2843"/>
        <skos:notation rdf:datatype="http://dewey.info">798.23</skos:notation>
        <skos:prefLabel xml:lang="it">Name of class</skos:prefLabel>
        <skos:editorialNote>whatever</skos:editorialNote>
        <skos:related rdf:resource="http://purl.org/../1654"/>
        <skos:broader rdf:resource="http://purl.org/../2843"/>
        <skos:inScheme rdf:resource="http://purl.org/../Thes"/>
        <skos:inScheme rdf:resource="http://purl.org/../ThesCF1"/>
    </owl:Class>
</rdf:RDF>
do you have any suggestions?
I could not find working examples with the API you mentioned above

Guillermo Esteban

unread,
May 21, 2013, 4:52:51 AM5/21/13
to skos...@googlegroups.com
That RDF/XML is not well formed (some namespaces missing).

I have tried the last SKOS API with OWL API 2.2.0 and it works. I've used the attached ontology like this:

SKOSManager manager = new SKOSManager();
SKOSDataset dataset = manager.loadDataset(URI.create("file:/c:/Users/ggp/Documents/junta.owl"));
for (SKOSConcept concept : dataset.getSKOSConcepts()) {
   System.out.println("Concept: " + concept.getURI());
}

You don't need to use OWL API, SKOS API manages it itself. I just followed the examples here.
junta.owl

Roberto Morelato

unread,
May 21, 2013, 6:04:18 AM5/21/13
to skos...@googlegroups.com

ok for XML formatting, it was only a fragment.
If I test your java snippet with (OWL API version 3.4.3) :
 
owlapi-distribution-3.4.3-bin 
i get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/semanticweb/owl/model/OWLOntologyStorageException

in this case the import is OK, but the error arise anyway
and this was the first notice that I posted

--------------------------------------------

otherwise with (version 2.2.0):
owlapi-src
I get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/semanticweb/owl/model/OWLOntologyStorageException

in this case "org/semanticweb/owl/model....." is not present in the API


--------------------------------------------

lastly I tested it with latest release "owlapi-distribution-3.4.4-bin" but always the same problem arise

Guillermo Esteban

unread,
May 21, 2013, 7:14:08 AM5/21/13
to skos...@googlegroups.com
You need to add owlapi-bin.jar into your compiling libraries.

Or extract and compile the sources from owlapi-src.jar yourself.

Best regards.

Roberto Morelato

unread,
May 22, 2013, 11:22:27 PM5/22/13
to skos...@googlegroups.com
I did it. I created a Library and imported the owlapi-src.jar, as for SKOS-API and JENA as well.
I noticed that it seems compulsory to work within a Maven project 
"The API is currently being build from within an IDE, a Maven script will be provided with the first alpha release. In order to complie the existing source you will need a copy of the latest OWL 2 API binary available..." (http://skosapi.sourceforge.net/source.html)

I'm not using Maven probably the problem is here.....
Reply all
Reply to author
Forward
0 new messages