Java Program to read Owl Ontology

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Program to read Owl Ontology

Surya Dhullipalla

I  want to create a JAVA program to create a an OwlParser to list the classes and their dataproperties, objectproperties that I designed in my owl file. I want to read this file in my JAVA program. I tried different jars from 3.4 version to 5.1 versions. owlapibinding-OwnManager and owlapi.OwlOntologyManager
I am getting  problem with these classes OWLManager and OWLOntologyManager classes.

Please advise what are the jars I need to import and if you have a link to them... These are the jars I have currently on the eclipse ide. 
Please advise. I am not sure what I am doing wrong here...




My sample code

package Ontology;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;
//import uk.ac.manchester.cs.owl.owlapi.concurrent.*;
import java.lang.reflect.InvocationTargetException;


import java.util.*;
import javax.inject.*;



public class OwlParser {
public static void main(String[] args) {
try {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
System.out.println("hello");
}
catch (Exception e) {
}
}

Thanks
Surya Dhullipalla Ph.D
Health Care Data Architect
IBM Watson Health


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Java Program to read Owl Ontology

kcason
Please a detailed list of the problems you are having, especially stack traces if you have them. 

-Kenny

On May 19, 2020, at 4:51 PM, Surya Dhullipalla <[hidden email]> wrote:



CAUTION: External Email





I  want to create a JAVA program to create a an OwlParser to list the classes and their dataproperties, objectproperties that I designed in my owl file. I want to read this file in my JAVA program. I tried different jars from 3.4 version to 5.1 versions. owlapibinding-OwnManager and owlapi.OwlOntologyManager
I am getting  problem with these classes OWLManager and OWLOntologyManager classes.

Please advise what are the jars I need to import and if you have a link to them... These are the jars I have currently on the eclipse ide. 
Please advise. I am not sure what I am doing wrong here...

<Image.895992242416.png>



My sample code

package Ontology;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;
//import uk.ac.manchester.cs.owl.owlapi.concurrent.*;
import java.lang.reflect.InvocationTargetException;


import java.util.*;
import javax.inject.*;



public class OwlParser {
public static void main(String[] args) {
try {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
System.out.println("hello");
}
catch (Exception e) {
}
}

Thanks
Surya Dhullipalla Ph.D
Health Care Data Architect
IBM Watson Health

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

Image.895992242416.png (44K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java Program to read Owl Ontology

Lorenz Buehmann
In reply to this post by Surya Dhullipalla

Honestly, you should use Maven in your project. And then as you did use the OWL API. They also provide examples how to read an ontology and get entities

On 19.05.20 23:51, Surya Dhullipalla wrote:

I  want to create a JAVA program to create a an OwlParser to list the classes and their dataproperties, objectproperties that I designed in my owl file. I want to read this file in my JAVA program. I tried different jars from 3.4 version to 5.1 versions. owlapibinding-OwnManager and owlapi.OwlOntologyManager
I am getting  problem with these classes OWLManager and OWLOntologyManager classes.

Please advise what are the jars I need to import and if you have a link to them... These are the jars I have currently on the eclipse ide. 
Please advise. I am not sure what I am doing wrong here...




My sample code

package Ontology;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;
//import uk.ac.manchester.cs.owl.owlapi.concurrent.*;
import java.lang.reflect.InvocationTargetException;


import java.util.*;
import javax.inject.*;



public class OwlParser {
public static void main(String[] args) {
try {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
System.out.println("hello");
}
catch (Exception e) {
}
}

Thanks
Surya Dhullipalla Ph.D
Health Care Data Architect
IBM Watson Health


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Java Program to read Owl Ontology

Ramsha
In reply to this post by Surya Dhullipalla
Hi, you can search for "an introduction to owl api" it's a kind of tutorial where you can find how to build a maven project which will handle all your dependencies. And how to create an owl manager.

On Wed, May 20, 2020, 2:51 AM Surya Dhullipalla <[hidden email]> wrote:

I  want to create a JAVA program to create a an OwlParser to list the classes and their dataproperties, objectproperties that I designed in my owl file. I want to read this file in my JAVA program. I tried different jars from 3.4 version to 5.1 versions. owlapibinding-OwnManager and owlapi.OwlOntologyManager
I am getting  problem with these classes OWLManager and OWLOntologyManager classes.

Please advise what are the jars I need to import and if you have a link to them... These are the jars I have currently on the eclipse ide. 
Please advise. I am not sure what I am doing wrong here...




My sample code

package Ontology;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;
//import uk.ac.manchester.cs.owl.owlapi.concurrent.*;
import java.lang.reflect.InvocationTargetException;


import java.util.*;
import javax.inject.*;



public class OwlParser {
public static void main(String[] args) {
try {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
System.out.println("hello");
}
catch (Exception e) {
}
}

Thanks
Surya Dhullipalla Ph.D
Health Care Data Architect
IBM Watson Health

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user