http://franz.com/ns/allegrograph/2.2/textindex/match
Perform AllegroGraph freetext queries.
This magic property can be used in several ways:
?subject fti:match 'queryPhrase' .
will perform a freetext query for 'queryPhrase'
and bind ?subject
to the subject of each triple found.
(?subject ?textObject) fti:match 'queryPhrase' .
will act as the first does but will also bind ?textObject
to the object of the triples found.
You can also supply a third binding on the subject side of the magic property which will be bound to the predicate of each matching triple. For example,
(?s ?text ?predicate) fti:match 'phrase' .
will bind ?s
to each matching subject, ?text
to each matching object, and ?predicate
to each matching predicate.
fti:match
also supports an additional argument on the object side that specifies which index to search. For example:
?subject fti:match ( 'queryPhrase' 'indexName' ) .
and
(?subject ?textObject) fti:match ( 'queryPhrase' 'indexName' ) .
and
(?subject ?textObject ?predicate) fti:match ( 'queryPhrase' 'indexName' ) .
will perform a freetext search for 'queryPhrase'
using only the specified index.
Note that fti:match
will parse the queryPhrase and return all triples that match the resulting query. For example, these two queries will return the same results:
select ?s { ?s fti:match 'only going' . }
select ?s { ?s fti:match 'going only' . }
and both will return bindings for ?s
from triples whose objects contain the words "only" and "going". See (cf. http://franz.com/ns/allegrograph/6.5.0/parseFreetextQuery or freetext-parse-query for details on how strings are parsed into complete freetext indexing expressions.)
See fti:matchExpression if you need to execute more sophisticated queries.
Notes
The following namespace abbreviations are used:
- fti - <http://franz.com/ns/allegrograph/2.2/textindex/>
- geo - <http://franz.com/ns/allegrograph/3.0/geospatial/>
- geofn - <http://franz.com/ns/allegrograph/3.0/geospatial/fn/>
- nd - <http://franz.com/ns/allegrograph/5.0/geo/nd#>
- ndfn - <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
- sna - <http://franz.com/ns/allegrograph/4.11/sna/>
The SPARQL magic properties reference has additional information on using AllegroGraph magic properties and functions.