I am not using Virtuoso, so I cant use bif-contains.
 
The intent is to get a list of all ?x where label has the substring
"engine"
So I would expect the result to be something  like:
 
label                             x
Jet engine                     id1
Steam engine                id2
Rocket engine               id3
Search engine               id4
 
I have used the following type of SPARQL on other endpoints
That don't use Virtuoso and it works fine.
Why doesn't this work for dbpedia????
 
PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
     SELECT      ?label ?x
     WHERE
      {
     ?x  rdfs:label ?label.
 
     FILTER regex(?label, "(?i)engine"@en).
 
}
 
 
Thanks, John
 
 
-----Original Message-----
From: Mauricio Chicalski [mailto:[email protected]] 
Sent: Tuesday, December 15, 2009 2:32 PM
To: John Abjanic
Cc: Richard Cyganiak; [email protected]
Subject: Re: [Dbpedia-discussion] problem with SPARQL query
 
hi,
with jena i use
PREFIX fn:<http://www.w3.org/2005/xpath-functions#
<http://www.w3.org/2005/xpath-functions> >
...
fn:contains(srt(?z), 'abc')

I dont remember why virtuoso get error with fn, so u need to use
bif:contains(), no external ns needed

ex:
PREFIX  property: <http://dbpedia.org/property/>

     SELECT ?y ?z
     WHERE
      {
     <http://dbpedia.org/resource/Land_Rover>  ?y ?z .
     FILTER bif:contains(?z, 'made')
     }

 if u try this filter in a large resultset it will time out

=]
On Tue, Dec 15, 2009 at 7:50 PM, John Abjanic <[email protected]>
wrote:
I also tried the following but it timed out, no response:

PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
<http://www.w3.org/1999/02/22-rdf-syntax-ns> >
 PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#
<http://www.w3.org/2000/01/rdf-schema> >

     SELECT      ?label ?x
     WHERE
      {
     ?x  rdfs:label ?label.
     FILTER regex(?label, "(?i)engine"@en).


Please advise.

-John

-----Original Message-----
From: Richard Cyganiak [mailto:[email protected]]
Sent: Tuesday, December 15, 2009 12:43 PM
To: John Abjanic
Cc: [email protected]
Subject: Re: [Dbpedia-discussion] problem with SPARQL query
Hi John,

Try "Jet engine"@en. The literal has an RDF language tag to indicate
that it's the English label.

Best,
Richard




On 15 Dec 2009, at 19:47, John Abjanic wrote:

> Hello all,
>
> I am trying to do the following:
>
> PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
<http://www.w3.org/1999/02/22-rdf-syntax-ns> >
> PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#
<http://www.w3.org/2000/01/rdf-schema> >
>
>      SELECT      ?label ?x
>      WHERE
>       {
>      ?x  rdfs:label ?label.
>     ?x  rdfs:label  "Jet engine"
>
>      }
>
>
> and I get no results
> but when I try:
>
> SELECT ?s ?p ?o
> WHERE {
> ?s ?p ?o.
> FILTER(?s = <http://dbpedia.org/resource/Jet_engine> ).
> }
>
> I get results and there is  label for "Jet engine"
>
> http://dbpedia.org/resource/Jet_engine
> http://www.w3.org/2000/01/rdf-schema#label
> Jet engine
>
>
>
>
> Why does the 1st SPARQL not work right?
>
> Thanks, John
>
------------------------------------------------------------------------
------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast
> and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Dbpedia-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


------------------------------------------------------------------------
------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and
easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
 
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to