views:

149

answers:

4

dear all i have an ontology that it doesnt have only one root class. it has 4 seperated classes(4 sub graph) ---1---- with listclasses() method i can't access 3 of them. this method lists one root class and its subclasses!

i want to get all classes of ontology.then i want to get "Thing" class to access all of classes!!! is this possible ???

-----2---- how can i compute distance between 2 classes? Could you give me an advise?

Thanks regards

A: 

i use jena and java. how to i load the ontology that define in my local machine and access the classes ? thanks:::

fateme.hosseini
-1 - this is not an answer. If you want to add more details, either edit your original question, or add comments to the question.
Stephen C
i think what i want is a very simple . i only need it. thank anyway
fateme.hosseini
@faty - we are having a lot of difficulty understanding what you are saying. For instance, I have no idea what your comment above means in relation to my *"this is not an answer"* comment.
Stephen C
i change my question.
fateme.hosseini
گم شو.- هیچ کمکی نمی کنید
fateme.hosseini
+1  A: 

You should go to the openjena.org site, and read all of the relevant documentation. In particular this example seems to do roughly what you are trying to do.

Stephen C
+1  A: 

It really depends what your goal is, i.e. what you're writing the program for. If you just want to visualise an ontology represented in a common xml-based language, e.g. RDF, OWL, then Protege would be a nice tool.

"Protégé is a free, open source ontology editor and knowledge-base framework."

http://protege.stanford.edu/

William
A: 

U CAN LORD THE ONTOLOGY BY USING URL of the OWL file....

sample code will look like this...

public class ontcreate {

/** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub

string uri = " "; // give base URI of your owl file or path u stored ur OWL file InputStream in = FileManager.get().open("E:/write/tourism1.owl"); OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,null);
model.read(in,null);


do the things you need    

} }