Re: [stardog-users] How to use regex filters and apf namespaces related method in the SPARQL on stardog front

11 views
Skip to first unread message

Mike Grove

unread,
Feb 26, 2013, 1:56:47 PM2/26/13
to stardog
On Tue, Feb 26, 2013 at 1:51 PM, Yadav Virendra <y.vir...@gmail.com> wrote:
Hi Everyone,

1. Is there any way where we can write SPARQL query using regex filters and get that working on the stardog CLI front, for e.g - .filter regex(?somevariable,'"somevalue")?

We support the standard SPARQL regex syntax, so you can use that.
 
2. Is there any provision of using PREFIX apf: <java:com.hp.hpl.jena.query.pfunction.library.> and provision of using corresponding methods for e.g. apf:splitIRI (?nspace ?plocal) get these working in stardog CLI, for me it gives error while querying the triple store. Any sample example is appreciated.

No, we don't support Jena-only extensions to Stardog.

Cheers,

Mike
 


Thanks..

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

Yadav Virendra

unread,
Feb 26, 2013, 2:06:54 PM2/26/13
to sta...@clarkparsia.com
Hi Mike,

Thanks for your quick reply, can you provide me any sample query with the regex filter in it. I mean more from syntax purpose. How it should be written? any helpful link with example will suffice.

Is there any alternate to jena extension that are present in stardog??

Thanks

Mike Grove

unread,
Feb 26, 2013, 2:18:48 PM2/26/13
to stardog
On Tue, Feb 26, 2013 at 2:06 PM, Yadav Virendra <y.vir...@gmail.com> wrote:
Hi Mike,

Thanks for your quick reply, can you provide me any sample query with the regex filter in it. I mean more from syntax purpose. How it should be written? any helpful link with example will suffice.

Here is an example of the syntax of using the regex syntax in SPARQL:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
 WHERE { ?x foaf:name  ?name
         FILTER regex(?name, "^ali", "i") }

This is taken from the SPARQL spec [1], which you can refer to for more gritty details of using regex. 

However, in most cases, regex is not a good solution for text searches.  Regexes are generally not very fast to evaluate, and on a sufficiently vague query or on a query over a large database, you can end up evaluating a regex, at query time, over a non-trivial portion of the *entire* database.  For full text searching, it's not really a scalable option.

For this reason, Stardog provides full-text search over all literals in the database using a fully integrated Lucene index.  You can query over the full-text index seamlessly with SPARQL using a simple syntax that integrations with lucene query syntax, or you can use the API support in SNARL to directly query the full-text index, again with using Lucene query syntax.  Details on using the Stardog search support at are [2] and information on how to administer them are at [3].


Is there any alternate to jena extension that are present in stardog??

The Jena filter extensions, such as splitURI?  No, not at present.  We'll probably support some of them in the future, but many of them are now available in SPARQL 1.1 as part of the language, such as startsWith and substring.
 
Cheers,

Mike


Cheers,

Mike
Reply all
Reply to author
Forward
0 new messages