Thanks so much Olivier, I need to go and experiment with these. will let you and others know what works best for this problem. BO
Bahador(reza)? OFOGHI, PhD Major: Information Technology ________________________________ From: Olivier Rossel <[email protected]> To: [email protected]; Bahador(reza)? OFOGHI <[email protected]> Sent: Thursday, 23 May 2013 8:05 PM Subject: Re: Owl Ontology and TDB Individuals While browsing the net, I just read that REQUIEM is an attempt by the OWL2 gurus to develop a query rewriter. http://www.cs.ox.ac.uk/isg/tools/Requiem/ Sounds uber cool. I would definitely appreciate any feedback about that tool. On Thu, May 23, 2013 at 10:45 AM, Olivier Rossel <[email protected]>wrote: > in that case, you need some inference at one time or another. > two strategies: > Strat 1: materialize the infered triples[1], inject in the DB, and then > query with the regular SPARQL engine (:ok for very small datasets, and > slow-changing data). for reasonably big data, you can use the OWL2-RL > subset of OWL2. as far as i know, an implementation of OWL2-RL exists with > drools, and you can play with it in protege or eulerGUI. > Strat 2: rewrite the query according to the data structure and run on > your existing dataset (:the current trade off for big data on top of OWL). > for that, you must use the OWL2-QL subset of OWL2. DBs such as stardog or > OWLIM handle such query rewriting, i do not know if fuseki has such a query > rewriter. > > as far as i understand, this is the global picture of OWL2+RDF. > i let the local gurus correct the above statements. > > > [1]: in our example, one infered tripe would be :DATA rdf:type :C > > > On Thu, May 23, 2013 at 1:53 AM, Bahador(reza)? OFOGHI < > [email protected]> wrote: > >> Yes, I would like to retrieve :DATA since in myOntology, there is this >> subClassOf relationship that can be traveresed by the reasoner. >> >> thanks. >> BO >> >> >> ________________________________ >> From: Olivier Rossel <[email protected]> >> To: [email protected]; Bahador(reza)? OFOGHI <[email protected]> >> Sent: Wednesday, 22 May 2013 6:54 PM >> Subject: Re: Owl Ontology and TDB Individuals >> >> >> Let's take an example to clarify. >> >> myOntology.owl: >> :SC rdfs:subClassOf :C >> >> myData.rdf: >> :DATA rdf:type :SC >> >> You want to retrieve all resources of type :C >> So you craft a SPARQL query for that: >> SELECT * WHERE {?s rdf:type :C} >> >> Do you expect such a query to return :DATA, or not? >> >> >> On Wed, May 22, 2013 at 12:47 AM, Bahador(reza)? OFOGHI < >> [email protected] >> > wrote: >> >> > Inference would be on concepts and based on the relationships between >> > them. Data will then be fecthed accordingly since they are instances of >> the >> > concepts, isn't it? I am not aware of whether it is generally possible >> to >> > do inference on data. >> > >> > >> > Bahador(reza)? OFOGHI, PhD >> > Major: Information Technology >> > >> > >> > >> > ________________________________ >> > From: Olivier Rossel <[email protected]> >> > To: [email protected]; Bahador(reza)? OFOGHI <[email protected]> >> > Sent: Tuesday, 21 May 2013 10:16 PM >> > Subject: Re: Owl Ontology and TDB Individuals >> > >> > >> > Is it inference on data themselves? Or on concepts only? >> > >> > >> > On Tue, May 21, 2013 at 11:54 AM, Bahador(reza)? OFOGHI < >> > [email protected] >> > > wrote: >> > >> > > Thanks Olivier, >> > > >> > > In fact, I do need to make use of inference in the OWL ontology. This >> is >> > a >> > > big ontology (being merged with some other ontologies) only one part >> of >> > > which is the names I have described. In this case, would you/anyone >> else >> > > have any ideas how I might be able to get this done. >> > > >> > > thanks again >> > > Bahador >> > > >> > > >> > > >> > > ________________________________ >> > > From: Olivier Rossel <[email protected]> >> > > To: [email protected]; Bahador(reza)? OFOGHI <[email protected] >> > >> > > Sent: Tuesday, 21 May 2013 7:42 PM >> > > Subject: Re: Owl Ontology and TDB Individuals >> > > >> > > >> > > Basically, you do not have to load both the OWL and the RDF in the DB. >> > > Such a RDF: >> > > :nameNumberOne a :NAME. >> > > :nameNumberOne :has_a :namePartNumberOne . >> > > :nameNumberOne :has_a :namePartNumberTwo . >> > > >> > > will load just fine in Fuseki. >> > > You can then query it without having to load the OWL in the DB. >> > > (RDF databases are mostly schemaless). >> > > >> > > The OWL is here just to be understood by the domain expert who >> > > creates the query. >> > > >> > > (Note: in an inference-aware DB, it *is* interesting to load both the >> OWL >> > > and the RDF together, but I do not think you have the need for >> > inference). >> > > >> > > >> > > On Tue, May 21, 2013 at 3:22 AM, Bahador(reza)? OFOGHI >> > > <[email protected]>wrote: >> > > >> > > > THanks Andy and David, >> > > > >> > > > I have now looked at this and I still have questions! >> > > > >> > > > 1- when you say transactions will not work across a mixture of >> graphs >> > in >> > > a >> > > > dataset, does that mean that I will not be able to query and/or use >> > > > reasoners on this dataset? >> > > > 2- if not, then what would be the best solution to keep an RDF/XML >> > > > ontology which will have thousands of individuals? I would have >> > thought I >> > > > could create the structure ontology (the OWL file) and keep it >> separate >> > > > from the data file (as in TDB) that will be assigned to the OWL >> > ontology >> > > > nodes. I am new to this field and I appreciate any hints. >> > > > >> > > > To make it more clear or refresh your memory, here is the problem I >> am >> > > > trying to solve: >> > > > >> > > > I have created an ontology in OWL somewhere in which I have a node >> > named >> > > > NAME which includes subparts of the name in NAME_PART1, ..., >> > NAME_PARTn. >> > > I >> > > > have a large CSV data file that has (many) records of names and the >> n >> > > name >> > > > parts. I will have to convert the CSV file into an RDF dataset >> (which I >> > > > will find a way for, should not be too complicated). Then, I need to >> > > make a >> > > > connection between the RDF dataset of these records and the OWL >> > ontology >> > > > that keeps the relationships between the concept nodes, e.g., NAME >> > has_a >> > > > NAME_PART1. >> > > > >> > > > Given that I have the two OWL and RDF files ready, what would I >> have to >> > > do >> > > > next to be able to query over the NAMEs and NAME_PARTs. What does it >> > take >> > > > to glue the two files? >> > > > >> > > > kind regards, >> > > > Bahador >> > > > >> > > > >> > > > >> > > > ________________________________ >> > > > From: David Jordan <[email protected]> >> > > > To: "[email protected]" <[email protected]> >> > > > Sent: Thursday, 16 May 2013 5:13 AM >> > > > Subject: RE: Owl Ontology and TDB Individuals >> > > > >> > > > >> > > > OK, now with your clarification it makes sense to me and is what I >> > > > expected. >> > > > >> > > > >> > > > -----Original Message----- >> > > > From: Andy Seaborne [mailto:[email protected]] >> > > > Sent: Wednesday, May 15, 2013 3:03 PM >> > > > To: [email protected] >> > > > Subject: Re: Owl Ontology and TDB Individuals >> > > > >> > > > On 15/05/13 18:47, David Jordan wrote: >> > > > > Andy, Please clarify something. In this reply, you state * Put the >> > > > > ontology in one named graph and the individuals in another one, or >> > the >> > > > > default graph, and hence in the same database? * You can put a >> single >> > > > > graph from TDB into a general dataset or just work with that one >> > graph >> > > > > (transactions will not work across a mixture of graphs in a >> dataset). >> > > > > >> > > > > You then reference the online docs that state: It is possible to >> use >> > > > > just one of the graphs from the dataset. A common way of working >> with >> > > > > one graph is to use the default graph of the dataset. >> > > > >> > > > >> > > > Dataset dataset = DatasetFactory.createMem() ; >> > > > Dataset tdb = TDBFactory.createDataset() ; >> > > > >> > > > // Pick one graph/model out of the dataset. >> > > > Model m1 = tdb.getNamedModel("http://example/tdb/graph") ; >> > > > dataset.addNamedModel("http://example/individuals", m1) ; >> > > > >> > > > // A model with completely different storage >> > > > Model m2 = ModelFactory.createDefaultModel() ; >> > > > dataset.addNamedModel("http://example/ontology", m2) ; >> > > > >> > > > ... a dataset with a mix of model storage implementations. >> > > > >> > > > > >> > > > > My code uses the interface com.hp.hpl.jena.query.Dataset. It >> allows >> > me >> > > > > to start/stop transactions and to access named models. I can >> access >> > > > > multiple named models. Isn't a model a graph in the database? >> > > > > Isn't a graph == model == graph ? You say that "transactions will >> not >> > > > > work across a mixture of graphs in a dataset". So a given >> > > > > com.hp.hpl.jena.query.Dataset object, while it can return multiple >> > > > > named Models, you cannot use them in the same transaction? >> > > > >> > > > then >> > > > >> > > > dataset.begin(ReadWrite.READ) ; >> > > > >> > > > ==> exception. "Transactions not supported" >> > > > >> > > > > When you said "a general dataset", are you referring to the >> default >> > > > > model/graph, which is stored in a triple table in SDB and >> essentially >> > > > > is using the single default graph managed by TDB/SDB? >> > > > >> > > > The kind of dataset returned by DatasetFactory.createMem() >> > > > >> > > > > Some of the wording used, both in the documentation and in your >> > reply, >> > > > > seem vague to me, with multiple interpretations. I don't believe >> the >> > > > > single sentence "It is possible to use just one of the graphs from >> > the >> > > > > dataset." is true. >> > > > >> > > > Could you suggest improvements? >> > > > >> > > > Andy >> > > > >> > > >> > >> > >
