Do you mind trying it with Fuseki 0.2.3? That contains ARQ 2.9.2 which has the performance improvement for MINUS queries that Andy was referring to.
-Stephen [1] http://www.apache.org/dist/jena/binaries/ On Thu, Jul 5, 2012 at 10:55 AM, Federico López <fic...@gmail.com> wrote: > Mi PC is an Intel Core 2 Quad Q2800 @2.33Ghz 2.33Ghz... And I have 4GB of > RAM... (Excuse my poor English) > > 2012/7/5 Federico López <fic...@gmail.com> > >> I try the two queries in my Java project (I usea ARQ 2.8.8 and Fuseki >> 0.2.2) using with JUnit test. >> With the FILTER NOT EXISTS sentece takes 0.724s (or less) querying the >> roots in RadLex Ontology ( 234.442 triples), with the MINUS sentence >> takes 56.762s (even more)... >> >> >> 2012/7/5 Andy Seaborne <a...@apache.org> >> >>> On 05/07/12 18:30, Milorad Tosic wrote: >>> >>>> Would there by any differences in performance or eventually in result >>>> set if we would substitute >>>> FILTER NOT EXISTS { ?root rdfs:subClassOf ?super } >>>> with >>>> >>>> MINUS { ?root rdfs:subClassOf ?super } >>>> in the previous query? >>>> >>>> Milorad >>>> >>> >>> Depends - also the required temporary memory needed is different. The >>> MINUS implement is quite performant now (previously it would have been >>> the case the FILTER version was faster). >>> >>> The FILTER version streams - constant memory overhead. >>> >>> The MINUS version uses temporary RAM - in proportion to the size of the >>> data matched. >>> >>> If there are a lot of rdfs:subClassOf, e.g. have expanded the inferences >>> previous, it could be the MINUS version is slower. >>> >>> You'll have to try to be definitive. If you try, do let us know. >>> >>> Andy >>> >>> >>> >>>> >>>> >>>> ______________________________**__ >>>>> From: Federico López <fic...@gmail.com> >>>>> To: users@jena.apache.org >>>>> Sent: Thursday, July 5, 2012 5:28 PM >>>>> Subject: Re: I need to get the root element of a ontology >>>>> >>>>> 2012/7/5 Andy Seaborne <a...@apache.org> >>>>> >>>>> On 05/07/12 06:49, Federico López wrote: >>>>>> >>>>>> I looking for a good quey that allows me to get the roots elements of >>>>>>> a >>>>>>> Ontology. Also, I need to know wich one of these roots have >>>>>>> children... >>>>>>> >>>>>>> >>>>>>> >>>>>>> Version of Jena used? >>>>>> I'm using fuseki 0.2.2... >>>>>> >>>>>> I have each ontology in a NAMED GRAPH.... >>>>>> >>>>>>> >>>>>>> >>>>>> And you are querying the union graph? >>>>>> >>>>> >>>>> >>>>> I'm Querying each GRAPH at time... >>>>> >>>>> >>>>>> >>>>>> >>>>>> This is what I using for it but the query is taking too much. >>>>>>> >>>>>>> >>>>>> How big is the data (in triples)? >>>>>> >>>>>> Well... I'm querying Biomedical Ontologies like FMA(1'859.969 >>>>> triples), >>>>> RadLex(234.442), ICD10(165.310)... >>>>> >>>>> >>>>>> Are you using inference? >>>>>> >>>>> >>>>> I don't.... >>>>> >>>>> >>>>>> >>>>>> >>>>>> SELECT DISTINCT ?root ?label (COUNT(?child) AS ?nChild) >>>>>>> FROM <http://ontologyURI> >>>>>>> WHERE >>>>>>> { >>>>>>> ?root a ?class . >>>>>>> ?class rdfs:subClassOf owl:Class . >>>>>>> ?root rdfs:label ?label . >>>>>>> OPTIONAL { >>>>>>> ?root rdfs:subClassOf ?super . >>>>>>> } >>>>>>> OPTIONAL { >>>>>>> ?child rdfs:subClassOf ?root . >>>>>>> } >>>>>>> FILTER (!bound(?super)) >>>>>>> } >>>>>>> GROUP BY ?root ?label >>>>>>> >>>>>>> Any idea? >>>>>>> >>>>>>> Thanks... >>>>>>> >>>>>>> >>>>>>> >>>>>>> without inference, this maybe what you want: I'm guessing from your >>>>>> description: >>>>>> >>>>>> SELECT ?root >>>>>> { >>>>>> # A root is something that is of type class >>>>>> # which has no super class mentioned. >>>>>> ?root rdf:type owl:Class . >>>>>> FILTER NOT EXISTS { ?root rdfs:subClassOf ?super } >>>>>> >>>>>> ?root rdfs:label ?label . >>>>>> } >>>>>> >>>>>> Adding in the COUNT of ?child and GROUP BY is unlikely to be cheap. >>>>>> >>>>>> SELECT ?root (COUNT(DISTINCT ?child) AS ?nChild) >>>>>> { >>>>>> # A root is something that is of type class >>>>>> # which has no super class mentioned. >>>>>> ?root rdf:type owl:Class . >>>>>> FILTER NOT EXISTS { ?root rdfs:subClassOf ?super } >>>>>> >>>>>> ?root rdfs:label ?label . >>>>>> # Children, any depth, by property paths >>>>>> OPTIONAL { ?child rdfs:subClassOf+ ?root } >>>>>> } >>>>>> GROUP BY ?root >>>>>> Andy >>>>>> >>>>>> >>>>> And thanks, I going to try your query, but I think that is just that I >>>>> need >>>>> :D >>>>> >>>>> -- >>>>> *FEDERICO LÓPEZ GÓMEZ* >>>>> Estudiante Ingeniería de Sistemas >>>>> Universidad del Valle - Sede Tuluá >>>>> >>>>> >>>>> >>>>> >>> >>> >> >> >> -- >> *FEDERICO LÓPEZ GÓMEZ* >> Estudiante Ingeniería de Sistemas >> Universidad del Valle - Sede Tuluá >> >> > > > -- > *FEDERICO LÓPEZ GÓMEZ* > Estudiante Ingeniería de Sistemas > Universidad del Valle - Sede Tuluá