--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
My intention is to use this query together with a full text search filter like this:---$ ./stardog query "test;reasoning=SL" "PREFIX sp: <tag:stardog:api:property:> SELECT DISTINCT ?s ?t ?score ?text WHERE { ?s sp:directType ?t; ?p ?text. ( ?text ?score ) <http://jena.hpl.hp.com/ARQ/property#textMatch> ('smithi~' 0.0 100). ?s a owl:NamedIndividual. ?t a owl:Class. ?p a owl:DatatypeProperty. }"com.clarkparsia.pellet.api.term.impl.entity.NamedIndividualImpl cannot be cast to com.clarkparsia.pellet.api.term.entity.NamedClass
---And this is the result I expect in this example:---data:JSmith edu:Student <score1> "Jonh Smithish"data:ASmithish edu:Student <score2> "Anna Smithish"---So, here are my questions for you:* I was expecting Stardog to return ONLY the most specific types for ?s, it's returning more than one type (even for the same ontology, Animal<-Person). Why and how can I fix that?
* Is it possible to remove the limit (100) in the #textMatch line and bound just the ?score (so I can sort the results)? I want a limit of 100 for the whole query, not for ?text (which I think could result in an empty result even if there are acceptable instances in the DB)
----
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
Best,
Héctor
Is there any chance to get the new release anytime soon or at least a patch or workaround for this query? I have to do a product demo in 2 weeks and the search module (on wich many other sections are based) use this kind of query heavily together with full text search.
I just checked the full text search query again without the limit, it's not needed as you said, thanks.
I continued testing the system and I found what seems to be another error. Consider the following query for the same ontology and data.select distinct ?type
where {
?s a ?type.
?s a owl:NamedIndividual.
?type a owl:Class.
}This one works fine, it returns all defined types (even those inferred through rdfs:doman and rdfs:name).Now, put the same data into a graph as my application does (because it deals with many kind of data so I separated it into graphs), the query becomes this:select distinct ?type
where {
graph ?g {
?s a ?type.
?s a owl:NamedIndividual.
?type a owl:Class.
}
}And this query returns nothing at all. Shouldn't it be equivalent? I tried putting the ontology on the default graph and the data on a named graph and it didn't help..Thank you for your time.
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
EDITED: never mind about what I wrote here initially, it was due to reasoning.schema.graphs having the value "default" instead of "all" :)
SELECT ?s ?type
WHERE {
?s a ?type.
?s a owl:NamedIndividual.
?type a owl:Class.
FILTER NOT EXISTS {
?s a ?type2.
?type2 rdfs:subClassOf ?type.
FILTER NOT EXISTS {
?type2 owl:equivalentClass ?type.
}
}
}
SELECT ?s ?type
WHERE {
?s a ?type.
?s a owl:NamedIndividual.
?type a owl:Class.
FILTER NOT EXISTS {
?s a ?type2.
?type2 rdfs:subClassOf+ ?type.
}
}
Thank you guys for your time!
--
Hello Mike,Given the ontology and data of my first post in this thread (http://www.apaste.info/mtml), I want to get all named individuals with their MOST specific type (just one).I first tried with sp:directType, but as Hector confirmed, there is/was a bug in Stardog so it's not working:
---$ ./stardog query "test;reasoning=SL" "PREFIX sp: <tag:stardog:api:property:> SELECT DISTINCT ?s ?t WHERE { ?s sp:directType ?t. ?s a owl:NamedIndividual. ?t a owl:Class. }"+----------------+------------------+| s | t |+----------------+------------------+| data:ASmithish | edu:Student || data:JSmith | net:Person || data:JSmith | owl:Thing || data:Geeks | owl:Thing || data:ASmithish | net:Animal || data:PRing | owl:Thing || data:Class01 | net:Organization || data:PRing | net:Person || data:JSmith | edu:Student || data:Class01 | edu:Group || data:ASmithish | net:Person || data:ASmithish | owl:Thing || data:PRing | net:Animal || data:JSmith | net:Animal || data:Class01 | owl:Thing || data:Geeks | net:Organization |+----------------+------------------+---
Then I tried with the query of my last message, but it returns the same results.Here is the expected result:
---
+----------------+------------------+| s | t |+----------------+------------------+| data:ASmithish | edu:Student |
| data:PRing | net:Person || data:JSmith | edu:Student || data:Class01 | edu:Group |
| data:Geeks | net:Organization |+----------------+------------------+---
Is that clear?