exact search via web console

0 views
Skip to first unread message

Conrad Leonard

unread,
Dec 1, 2014, 7:57:03 PM12/1/14
to sta...@clarkparsia.com
I would like to force an exact search on my data via web console search widget. 

Using the CLI tool I can just wrap the search term in double quotes and it works, but I can't find a way to do this through the console.

Example data:
[conradL@momerath search-testing]$ cat test-data.ttl 
@prefix ex: <http://example.org/> .

ex:a0 a owl:Thing;
rdfs:label '''ICGC-ABMB-20130430-014''' .
ex:a1 a owl:Thing;
rdfs:label '''ICGC-ABMB-20120905-060''' .
ex:a2 a owl:Thing;
rdfs:label '''ICGC-ABMB-20120905-104''' .
ex:a3 a owl:Thing;
rdfs:label '''ICGC-ABMB-20120905-001''' .
ex:a4 a owl:Thing;
rdfs:label '''ICGC-DBLG-20100205-22-TR''' .
ex:a5 a owl:Thing;
rdfs:label '''ICGC-ABMB-20131010-018''' .



create search enabled db:
[conradL@momerath search-testing]$ stardog-admin db drop searchtestdb ; stardog-admin db create -n searchtestdb -o "search.enabled=true" -- test-data.ttl 


search via CLI for non-exact term:
[conradL@momerath ~]$ stardog query "searchtestdb" "select ?s ?p ?o ?score where {?s ?p ?o . (?o ?score) <http://jena.hpl.hp.com/ARQ/property#textMatch> ('ICGC-ABMB-20131010-018')}"
+-------+------------+----------------------------+------------------------------------------------------------------+
|   s   |     p      |             o              |                              score                               |
+-------+------------+----------------------------+------------------------------------------------------------------+
| ex:a0 | rdfs:label | "ICGC-ABMB-20130430-014"   | "0.5472487211227417"^^<http://www.w3.org/2001/XMLSchema#double>  |
| ex:a1 | rdfs:label | "ICGC-ABMB-20120905-060"   | "0.5472487211227417"^^<http://www.w3.org/2001/XMLSchema#double>  |
| ex:a2 | rdfs:label | "ICGC-ABMB-20120905-104"   | "0.5472487211227417"^^<http://www.w3.org/2001/XMLSchema#double>  |
| ex:a3 | rdfs:label | "ICGC-ABMB-20120905-001"   | "0.5472487211227417"^^<http://www.w3.org/2001/XMLSchema#double>  |
| ex:a4 | rdfs:label | "ICGC-DBLG-20100205-22-TR" | "0.34726911783218384"^^<http://www.w3.org/2001/XMLSchema#double> |
| ex:a5 | rdfs:label | "ICGC-ABMB-20131010-018"   | "3.3946738243103027"^^<http://www.w3.org/2001/XMLSchema#double>  |
+-------+------------+----------------------------+------------------------------------------------------------------+

Query returned 6 results in 00:00:00.041

as I expect, this returns all the data because at least one of the '-' separated tokens in the search term appears in every rdfs:label.

now wrap the search term in double quotes to perform exact search:
[conradL@momerath ~]$ stardog query "searchtestdb" "select ?s ?p ?o ?score where {?s ?p ?o . (?o ?score) <http://jena.hpl.hp.com/ARQ/property#textMatch> ('\"ICGC-ABMB-20131010-018\"')}"
+-------+------------+--------------------------+-----------------------------------------------------------------+
|   s   |     p      |            o             |                              score                              |
+-------+------------+--------------------------+-----------------------------------------------------------------+
| ex:a5 | rdfs:label | "ICGC-ABMB-20131010-018" | "6.1252546310424805"^^<http://www.w3.org/2001/XMLSchema#double> |
+-------+------------+--------------------------+-----------------------------------------------------------------+

Query returned 1 results in 00:00:00.040

as I expect because only one rdfs:label matches the exact string "ICGC-ABMB-20131010-018".

Through the console however, supplying "ICGC-ABMB-20131010-018" (with quotes) into the search widget at top right of the page still returns all 6 records. Using the the Advanced Search "this exact phrase" field with no quotes again returns all 6 records, and with quotes does not do anything, i.e. does not appear to perform a search at all. Even more oddly, if I supply the space-separated tokens without quotes: ICGC ABMB 20131010 018 to the "this exact phrase" field then only a single record is returned, but it is not the expected one - it is ICGC-DBLG-20100205-22-TR.

Is there some escaping or other mechanism I can use to make this search work as expected through the UI?

Edgar Rodriguez

unread,
Dec 2, 2014, 10:52:33 AM12/2/14
to sta...@clarkparsia.com
We were able to reproduce the behavior, it's a bug related to the encoding of the search term for this case. The fix will be included in the next release.

Thank you for the report.

Best,
Edgar

--
-- --
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

Conrad Leonard

unread,
Dec 2, 2014, 7:48:22 PM12/2/14
to sta...@clarkparsia.com
Thanks Edgar.
Reply all
Reply to author
Forward
0 new messages