I understand that we can list the members of a certain class in Protege. All I need to do is to start the reasoner, visit the DL Query tab, put the name of the class in the Query box, keep Instances checked and the press Execute. I get a list of all the individuals who belong to this class.
I wanted to issue a DL query to check whether individual a belongs to class A.
Is there a way I can do this in Protege? If this is not possible in Protege, is there an alternative?
You could write something like this: {a} and A.
If a belongs to A, then it will be displayed in the "Instances" section:
One would have to be able to use Snap SPARQL Query Plugin for this purpose.
Snap SPARQL Query Plugin, as opposed to SPARQL Query Plugin, is able to work with inferred knowledge.
Unfortunately, Snap SPARQL Query Plugin does not support ASK queries. Try the following:
SELECT DISTINCT ?is WHERE { :a rdf:type :A . BIND (("Found!") AS ?is) }
Related
I have 10 search definition of exact similar schema in Vespa, I want to merge (union) them all.
Example-
I have search_definition_1.sd
I have search_definition_2.sd
I have search_definition_3.sd
.
.
.
I have search_defination_10.sd
Now I need to search from all of the search definition at once, is it possible to union them all and create new search_definition_1_to_10.sd or search in all of at once.
Vespa will by default query all schemas (document types), so supported out of the box. For more fine-grained control, see https://docs.vespa.ai/documentation/federation.html
I did not get what you mean by 10 exact similar schemas, though, there should be no need to have identical schemas.
Unless you use the restrict parameter to restrict to a document type Vespa federates and searches all document types in a content cluster and merges the hits by relevancy score. See end of this document https://docs.vespa.ai/documentation/schemas.html#querying-multiple-document-types and https://docs.vespa.ai/documentation/reference/query-api-reference.html#model.restrict
We are trying to group phrases together in order to improve results.
For instance, if the user asks a question like "When do I have to change the filter of my air conditioning?" with a domain specific phrase such as “air conditioning”, R&R returns some answers containing the term “air” and no “conditioning” or it returns answers containing other terms like air bag or air filter.
This can be accomplish using a raw Solr instance and set the phrase between quotes. So, the Solr query would look like the following:
...
"debug": {
"rawquerystring": "When do I have to change the filter of my \"air conditioning\" ?",
"querystring": "When do I have to change the filter of my \"air conditioning\" ?",
"parsedquery": "text:when text:do text:i text:have text:to text:change text:the text:filter text:of text:my PhraseQuery(text:\"air conditioning\") text:?",
"parsedquery_toString": "text:when text:do text:i text:have text:to text:change text:the text:filter text:of text:my text:\"air conditioning\" text:?",
...
However, the R&R guide states:
The syntax is different from standard Solr syntax as follows:
You can search for a single term, or a phrase. You do not need to
surround the phrase with double quotation marks as with Solr, but you
can include phrases in the query and they are accounted for by the
ranker models.
We could not find more details regarding the above statement.
But, as we understand, the ranker is supposed to identify phrases. If that is the case, we were wondering if there is a way where we can set a dictionary of phrases in order to tune the ranker?
Or, could we set our own model of legal phrases? What are the options to accomplish this goal?
Thanks
Currently RnR doesn't support strict phrase querying, though there are features that will take term ordering and adjacent terms into consideration. We are working on a new version of service, in which users would be able to use full regular solr query syntax (including specifying phrases) for document retrieving.
I've worked with solr some in the past, but mostly the searching has been straight forward. We've now got a situation where we'd like to have searches that can restrict results on an "AND" ... using the example as follows:
Doc 1 --> StudentID:123 ClassID: 001
Doc 2 --> StudentID:123 ClassID:002
Doc 3 --> StudentID:987 ClassID:001
The "English" version of the desired query would be "Give me all students in classes with classID:001 and ClassID:002. This would only return StudentID:123 and leave out Student:987.
Granted, our actually query is much more complex than this b/c the class could also have other properties like time, day, etc. But I wanted to see if I could get some help in accomplishing the basic "AND" filtering first.
This is how we are currently implementing it and it "seems" to work, but since the number of classes can be dynamic, it means we'll need to dynamically update the mincount. Just curious if there's a "better" way of doing it.
q=*:*&fq=(ClassID:001)OR(ClassID:002)&rows=0&group=true&group.field=ClassID&group.facet=true&group.ngroups=true&facet=true&facet.field=ClassID&facet.mincount=2&facet.field=StudentID
I'm sure there's a straight forward way that I haven't found yet, so I'm handing the question off to the experts. Help is appreciated!
You could set your default operator in your schema.xml to be OR. This assumes that all (or most) of the cases would want to do an OR querying.
Then you could change your query to be something like this:
classId:('001' '002')
Since your class Ids are dynamic, you could inject this value by joining a list of classids from your client .
I am wondering if there is anyway to transform an end user query to a more complicated solr query based on some rules.
For example, if the user types in 32" television, then I want to use the dismax query parser to let solr take care of this user query string like below:
http://localhost:8983/solr/select/?q=32" television&defType=dismax
However, if the user types in "televisions on sale", then I want to do a regular search for token televisions and onsale flag is true like below:
http://localhost:8983/solr/select/?q=name:televisions AND isOnSale:true
Is this possible? Or must this logic require an advance search form where the user can clearly state in a checkbox that they only want on sale items.
Thanks.
Transforming the user query is quite possible. You can do it in following two ways
implement a Servlet Filter that listens to user query transforms it before dispatching it to solr request handler.
Look at query parser plugin in SOLR and implement one based on the existing one like standard query parser and modify it to apply transformation rules.
Let the search happen through the whole index and let the user choose. If a review shows up, render it with the appropriate view. If a product shows up, offer to search for more products.
Samsung 32 in reviews --read more
LG 32 in offers --find more like this
Your offers page can offer more options, such as filtering products on sale.
You may use a global boost field on documents. For example, a product on sale has a score of 1.0 while out of stock products have 0.33. A review of a new products has 1.0, old products have less.
Maybe you can set up the search so when someone searches for whatever have isOnSale as a secondary sort parameter. So by default sort by score then sort by isonsale or just sort by isonsale. That way you will still get all "television" ads in the results just the ones on sale are on top.
I am trying to update my filter currently appled to the People Picker in SharePoint (WSS).
I am using stsadm to set the filter.
Something like...
stsadm -o setproperty -url http://webserver:39770 -pn peoplepicker-searchadcustomfilter -pv "(&(userAccountControl=512)(objectCategory=person)(objectClass=user)(memberOf=cn=All Users Group,ou=E-Mail Distribution Lists,dc=domain,dc=com,dc=au))"
I know how to do this but want to change the LDAP query. This is where I need your help.
I would like to query an OU in AD and return all the groups in it.
As a fall back I could put all groups in the OU into their own group and just query the group using the following query...
(&(memberOf=CN=WSSPeoplePickerGroup,OU=Groups,DC=domain,DC=com,DC=au)(objectCategory=group))
... but I would like to directly query the OU if I can. It has become a bone I don't want to let go of just yet, so hopefully there is someone smarter than me out there.
I think where I need to head is something like the following query I found. As I understand it this is known as an extensible search match and they are filtering on the 'name' of OU but I am having trouble seeing how I might apply this to what I want (despite the numerous attempts I have made), if this is indeed the approach I should take.
(&(objectClass=group)(&(ou:dn:=Chicago)(!(ou:dn:=Wrigleyville))))
TIA
If you want search a particular OU only. Why not just search by the distinguishedName?
In your case, maybe something like this.
(distinguishedName=*ou=E-Mail Distribution Lists,dc=domain,dc=com,dc=au)
which will be equivalent to searching the OU E-Mail Distribution.
And also userAccountControl=512 does not mean all enabled user. It just searches for Normal account. A better way would be to search whether the Disabled flag is set.
Use this instead of userAccountControl=512 to find all users which are not disabled.
(!(userAccountControl:1.2.840.113556.1.4.803:=2))
fyi.