You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Rafiq <ak...@univ-lyon1.fr> on 2014/01/07 19:00:15 UTC
query
Hi,
Here is my query
SELECT ?x ?y WHERE {
?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Student> .
?y <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Course> .
<http://www.Department0.University0.edu/AssociateProfessor0>
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> ?y .
?x
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#takesCourse> ?y
}
When I execute it I get the answer below:
{
"head": {
"vars": [ "x" , "y" ]
} ,
"results": {
"bindings": [
]
}
}
I could not find any valid reason why it returns this answer. I
validated the query using online validator, its absolutely fine.
Then I modify the query.. the query turns into the following:
'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course .
?AssociateProfessor0 ?teacherOf ?y . ?x ?takesCourse ?y}'
I left it two days, it did not return anything because the query could
not be parsed. Where did I do mistake if I did any?
I have a few modified queries with single variable worked fine however,
this one did not. I want to believe
the number of variable when is two (X, Y) creating a problem?
For your information, I am using Fuseqi server with TDB store.
Regards,
Rafiq
Re: query
Posted by Andy Seaborne <an...@apache.org>.
On 07/01/14 20:40, HAQUE AKM RAFIQUL wrote:
> As I said in my previous mail,
> I escaped prefix matching part by modifying the queries and it worked but it is not
> working if the query contains more than one variable.
>
> @Andy, you benchmarked TDB using LUBM.. I am doing the same. I would assume you have a suggestion
> for me. This is one (7th) of the fourteen LUBM queries.
Query 7 is:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ub: <http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#>
SELECT * WHERE
{
?x rdf:type ub:Student .
?y rdf:type ub:Course .
<http://www.Department0.University0.edu/AssociateProfessor0>
ub:teacherOf ?y .
?x ub:takesCourse ?y .
}
which has grounded predicates are grounded.
This is very different as far as the TDB optimizer is concerned to:
> 'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course . ?AssociateProfessor0 ?teacherOf ?y . ?x ?takesCourse ?y}'
Did you install a stats file for TDB?
How much RAM does the machine have? (not java heap).
<http://www.Department0.University0.edu/AssociateProfessor0>
ub:teacherOf ?y is a very selective pattern and TDB will start there.
Even without a stats file, it starts on that pattern.
Andy
>
> Regards,
> Rafiq
>
>
> ________________________________________
> From: Andy Seaborne [andy@apache.org]
> Sent: Tuesday, January 07, 2014 8:33 PM
> To: users@jena.apache.org
> Subject: Re: query
>
> On 07/01/14 19:17, Rafiq wrote:
>> @prefix: <http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#> .
>
> does not match your query.
>
> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#
>
> %7Ezhp2 vs ~zhp2
>
> They are not the same. % is not en escape mechanism. It really is %-7-E
> in the data.
>
> Andy
>
>
>> @prefix owl: <http://www.w3.org/2002/07/owl#> .
>>
>>
>> On 01/07/2014 08:12 PM, Andy Seaborne wrote:
>>> What is the ":" prefix?
>>>
>>> On 07/01/14 18:42, Rafiq wrote:
>>>> Sample data
>>>>
>>>> <http://www.Department4.University3.edu> a :Department .
>>>>
>>>> <http://www.Department4.University3.edu> :name "Department4" .
>>>>
>>>> <http://www.Department4.University3.edu> :subOrganizationOf
>>>> <http://www.University3.edu> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> a
>>>> :AssistantProfessor .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>>> :doctoralDegreeFrom <http://www.University2980.edu> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>>> :emailAddress "AssistantProfessor0@Department4.University3.edu" .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>>> :mastersDegreeFrom <http://www.University2549.edu> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :name
>>>> "AssistantProfessor0" .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>>> :researchInterest "Research38" .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>>> <http://www.Department4.University3.edu/Course29> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>>> <http://www.Department4.University3.edu/Course30> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>>> <http://www.Department4.University3.edu/GraduateCourse29> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>>> <http://www.Department4.University3.edu/GraduateCourse30> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :telephone
>>>> "xxx-xxx-xxxx" .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>>> :undergraduateDegreeFrom <http://www.University10318.edu> .
>>>>
>>>> <http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
>>>> <http://www.Department4.University3.edu> .
>>>>
>>>>
>>>
>>
>
RE: query
Posted by HAQUE AKM RAFIQUL <ak...@univ-lyon1.fr>.
As I said in my previous mail, I escaped prefix matching part by modifying the queries and it worked but it is not
working if the query contains more than one variable.
@Andy, you benchmarked TDB using LUBM.. I am doing the same. I would assume you have a suggestion
for me. This is one (7th) of the fourteen LUBM queries.
Regards,
Rafiq
________________________________________
From: Andy Seaborne [andy@apache.org]
Sent: Tuesday, January 07, 2014 8:33 PM
To: users@jena.apache.org
Subject: Re: query
On 07/01/14 19:17, Rafiq wrote:
> @prefix: <http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#> .
does not match your query.
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#
%7Ezhp2 vs ~zhp2
They are not the same. % is not en escape mechanism. It really is %-7-E
in the data.
Andy
> @prefix owl: <http://www.w3.org/2002/07/owl#> .
>
>
> On 01/07/2014 08:12 PM, Andy Seaborne wrote:
>> What is the ":" prefix?
>>
>> On 07/01/14 18:42, Rafiq wrote:
>>> Sample data
>>>
>>> <http://www.Department4.University3.edu> a :Department .
>>>
>>> <http://www.Department4.University3.edu> :name "Department4" .
>>>
>>> <http://www.Department4.University3.edu> :subOrganizationOf
>>> <http://www.University3.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> a
>>> :AssistantProfessor .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :doctoralDegreeFrom <http://www.University2980.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :emailAddress "AssistantProfessor0@Department4.University3.edu" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :mastersDegreeFrom <http://www.University2549.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :name
>>> "AssistantProfessor0" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :researchInterest "Research38" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/Course29> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/Course30> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/GraduateCourse29> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/GraduateCourse30> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :telephone
>>> "xxx-xxx-xxxx" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :undergraduateDegreeFrom <http://www.University10318.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
>>> <http://www.Department4.University3.edu> .
>>>
>>>
>>
>
Re: query
Posted by Andy Seaborne <an...@apache.org>.
On 07/01/14 19:17, Rafiq wrote:
> @prefix: <http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#> .
does not match your query.
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#
%7Ezhp2 vs ~zhp2
They are not the same. % is not en escape mechanism. It really is %-7-E
in the data.
Andy
> @prefix owl: <http://www.w3.org/2002/07/owl#> .
>
>
> On 01/07/2014 08:12 PM, Andy Seaborne wrote:
>> What is the ":" prefix?
>>
>> On 07/01/14 18:42, Rafiq wrote:
>>> Sample data
>>>
>>> <http://www.Department4.University3.edu> a :Department .
>>>
>>> <http://www.Department4.University3.edu> :name "Department4" .
>>>
>>> <http://www.Department4.University3.edu> :subOrganizationOf
>>> <http://www.University3.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> a
>>> :AssistantProfessor .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :doctoralDegreeFrom <http://www.University2980.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :emailAddress "AssistantProfessor0@Department4.University3.edu" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :mastersDegreeFrom <http://www.University2549.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :name
>>> "AssistantProfessor0" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :researchInterest "Research38" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/Course29> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/Course30> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/GraduateCourse29> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>>> <http://www.Department4.University3.edu/GraduateCourse30> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :telephone
>>> "xxx-xxx-xxxx" .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0>
>>> :undergraduateDegreeFrom <http://www.University10318.edu> .
>>>
>>> <http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
>>> <http://www.Department4.University3.edu> .
>>>
>>>
>>
>
Re: query
Posted by Rafiq <ak...@univ-lyon1.fr>.
@prefix: <http://www.lehigh.edu/%7Ezhp2/2004/0401/univ-bench.owl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
On 01/07/2014 08:12 PM, Andy Seaborne wrote:
> What is the ":" prefix?
>
> On 07/01/14 18:42, Rafiq wrote:
>> Sample data
>>
>> <http://www.Department4.University3.edu> a :Department .
>>
>> <http://www.Department4.University3.edu> :name "Department4" .
>>
>> <http://www.Department4.University3.edu> :subOrganizationOf
>> <http://www.University3.edu> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> a
>> :AssistantProfessor .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0>
>> :doctoralDegreeFrom <http://www.University2980.edu> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0>
>> :emailAddress "AssistantProfessor0@Department4.University3.edu" .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0>
>> :mastersDegreeFrom <http://www.University2549.edu> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :name
>> "AssistantProfessor0" .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0>
>> :researchInterest "Research38" .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>> <http://www.Department4.University3.edu/Course29> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>> <http://www.Department4.University3.edu/Course30> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>> <http://www.Department4.University3.edu/GraduateCourse29> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
>> <http://www.Department4.University3.edu/GraduateCourse30> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :telephone
>> "xxx-xxx-xxxx" .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0>
>> :undergraduateDegreeFrom <http://www.University10318.edu> .
>>
>> <http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
>> <http://www.Department4.University3.edu> .
>>
>>
>
Re: query
Posted by Andy Seaborne <an...@apache.org>.
What is the ":" prefix?
On 07/01/14 18:42, Rafiq wrote:
> Sample data
>
> <http://www.Department4.University3.edu> a :Department .
>
> <http://www.Department4.University3.edu> :name "Department4" .
>
> <http://www.Department4.University3.edu> :subOrganizationOf
> <http://www.University3.edu> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> a
> :AssistantProfessor .
>
> <http://www.Department4.University3.edu/AssistantProfessor0>
> :doctoralDegreeFrom <http://www.University2980.edu> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0>
> :emailAddress "AssistantProfessor0@Department4.University3.edu" .
>
> <http://www.Department4.University3.edu/AssistantProfessor0>
> :mastersDegreeFrom <http://www.University2549.edu> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :name
> "AssistantProfessor0" .
>
> <http://www.Department4.University3.edu/AssistantProfessor0>
> :researchInterest "Research38" .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
> <http://www.Department4.University3.edu/Course29> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
> <http://www.Department4.University3.edu/Course30> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
> <http://www.Department4.University3.edu/GraduateCourse29> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
> <http://www.Department4.University3.edu/GraduateCourse30> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :telephone
> "xxx-xxx-xxxx" .
>
> <http://www.Department4.University3.edu/AssistantProfessor0>
> :undergraduateDegreeFrom <http://www.University10318.edu> .
>
> <http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
> <http://www.Department4.University3.edu> .
>
>
Re: query
Posted by Rafiq <ak...@univ-lyon1.fr>.
Sample data
<http://www.Department4.University3.edu> a :Department .
<http://www.Department4.University3.edu> :name "Department4" .
<http://www.Department4.University3.edu> :subOrganizationOf
<http://www.University3.edu> .
<http://www.Department4.University3.edu/AssistantProfessor0> a
:AssistantProfessor .
<http://www.Department4.University3.edu/AssistantProfessor0>
:doctoralDegreeFrom <http://www.University2980.edu> .
<http://www.Department4.University3.edu/AssistantProfessor0>
:emailAddress "AssistantProfessor0@Department4.University3.edu" .
<http://www.Department4.University3.edu/AssistantProfessor0>
:mastersDegreeFrom <http://www.University2549.edu> .
<http://www.Department4.University3.edu/AssistantProfessor0> :name
"AssistantProfessor0" .
<http://www.Department4.University3.edu/AssistantProfessor0>
:researchInterest "Research38" .
<http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
<http://www.Department4.University3.edu/Course29> .
<http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
<http://www.Department4.University3.edu/Course30> .
<http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
<http://www.Department4.University3.edu/GraduateCourse29> .
<http://www.Department4.University3.edu/AssistantProfessor0> :teacherOf
<http://www.Department4.University3.edu/GraduateCourse30> .
<http://www.Department4.University3.edu/AssistantProfessor0> :telephone
"xxx-xxx-xxxx" .
<http://www.Department4.University3.edu/AssistantProfessor0>
:undergraduateDegreeFrom <http://www.University10318.edu> .
<http://www.Department4.University3.edu/AssistantProfessor0> :worksFor
<http://www.Department4.University3.edu> .
On 01/07/2014 07:35 PM, Rafiq wrote:
> Joshua, thanks for the response...and I am aware what you said.
>
> I expect an answer because I received answer of this query using other
> triplestores.
> I generated this dataset using LUBM data generator. The dataset
> contains 153 million triples.
>
>
>
> On 01/07/2014 07:17 PM, Joshua TAYLOR wrote:
>> Just because the query is legal SPARQL doesn't mean that it it matches
>> any of your data? I can send this query to DBpedia, and I get no
>> results, not because there's no such person, but because DBpedia
>> doesn't include any data about this person:
>>
>> select ?person where ui
>> ?person a dbpedia-owl:Person ;
>> foaf:name "Rafiq"@en ;
>> }
>>
>> What's your data? Why do you expect your query to work?
>>
>> On Tue, Jan 7, 2014 at 1:00 PM,
>> Rafiq<ak...@univ-lyon1.fr> wrote:
>>> Hi,
>>>
>>> Here is my query
>>>
>>> SELECT ?x ?y WHERE {
>>> ?x<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Student> .
>>> ?y<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Course> .
>>> <http://www.Department0.University0.edu/AssociateProfessor0>
>>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> ?y .
>>> ?x<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#takesCourse> ?y
>>> }
>>>
>>> When I execute it I get the answer below:
>>>
>>> {
>>> "head": {
>>> "vars": [ "x" , "y" ]
>>> } ,
>>> "results": {
>>> "bindings": [
>>>
>>> ]
>>> }
>>> }
>>>
>>> I could not find any valid reason why it returns this answer. I
>>> validated
>>> the query using online validator, its absolutely fine.
>>> Then I modify the query.. the query turns into the following:
>>>
>>> 'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course .
>>> ?AssociateProfessor0
>>> ?teacherOf ?y . ?x ?takesCourse ?y}'
>>>
>>> I left it two days, it did not return anything because the query
>>> could not
>>> be parsed. Where did I do mistake if I did any?
>>>
>>>
>>> I have a few modified queries with single variable worked fine
>>> however, this
>>> one did not. I want to believe
>>> the number of variable when is two (X, Y) creating a problem?
>>>
>>>
>>> For your information, I am using Fuseqi server with TDB store.
>>>
>>> Regards,
>>> Rafiq
>>
>
Re: query
Posted by Rafiq <ak...@univ-lyon1.fr>.
Joshua, thanks for the response...and I am aware what you said.
I expect an answer because I received answer of this query using other
triplestores.
I generated this dataset using LUBM data generator. The dataset
contains 153 million triples.
On 01/07/2014 07:17 PM, Joshua TAYLOR wrote:
> Just because the query is legal SPARQL doesn't mean that it it matches
> any of your data? I can send this query to DBpedia, and I get no
> results, not because there's no such person, but because DBpedia
> doesn't include any data about this person:
>
> select ?person where ui
> ?person a dbpedia-owl:Person ;
> foaf:name "Rafiq"@en ;
> }
>
> What's your data? Why do you expect your query to work?
>
> On Tue, Jan 7, 2014 at 1:00 PM, Rafiq<ak...@univ-lyon1.fr> wrote:
>> Hi,
>>
>> Here is my query
>>
>> SELECT ?x ?y WHERE {
>> ?x<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Student> .
>> ?y<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Course> .
>> <http://www.Department0.University0.edu/AssociateProfessor0>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> ?y .
>> ?x<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#takesCourse> ?y
>> }
>>
>> When I execute it I get the answer below:
>>
>> {
>> "head": {
>> "vars": [ "x" , "y" ]
>> } ,
>> "results": {
>> "bindings": [
>>
>> ]
>> }
>> }
>>
>> I could not find any valid reason why it returns this answer. I validated
>> the query using online validator, its absolutely fine.
>> Then I modify the query.. the query turns into the following:
>>
>> 'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course . ?AssociateProfessor0
>> ?teacherOf ?y . ?x ?takesCourse ?y}'
>>
>> I left it two days, it did not return anything because the query could not
>> be parsed. Where did I do mistake if I did any?
>>
>>
>> I have a few modified queries with single variable worked fine however, this
>> one did not. I want to believe
>> the number of variable when is two (X, Y) creating a problem?
>>
>>
>> For your information, I am using Fuseqi server with TDB store.
>>
>> Regards,
>> Rafiq
>
Re: query
Posted by Andy Seaborne <an...@apache.org>.
On 07/01/14 18:17, Joshua TAYLOR wrote:
> Just because the query is legal SPARQL doesn't mean that it it matches
> any of your data? I can send this query to DBpedia, and I get no
> results, not because there's no such person, but because DBpedia
> doesn't include any data about this person:
>
> select ?person where {
> ?person a dbpedia-owl:Person ;
> foaf:name "Rafiq"@en ;
> }
>
> What's your data? Why do you expect your query to work?
Yes - please show a sample of data.
and make sure whether you have ~zhp2 or %7Ezhp2 becau ethey are
different URIs.
>
> On Tue, Jan 7, 2014 at 1:00 PM, Rafiq <ak...@univ-lyon1.fr> wrote:
>> Hi,
>>
>> Here is my query
>>
>> SELECT ?x ?y WHERE {
>> ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Student> .
>> ?y <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Course> .
>> <http://www.Department0.University0.edu/AssociateProfessor0>
>> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> ?y .
>> ?x <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#takesCourse> ?y
>> }
>>
>> When I execute it I get the answer below:
>>
>> {
>> "head": {
>> "vars": [ "x" , "y" ]
>> } ,
>> "results": {
>> "bindings": [
>>
>> ]
>> }
>> }
>>
>> I could not find any valid reason why it returns this answer. I validated
>> the query using online validator, its absolutely fine.
>> Then I modify the query.. the query turns into the following:
>>
>> 'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course . ?AssociateProfessor0
>> ?teacherOf ?y . ?x ?takesCourse ?y}'
>>
>> I left it two days, it did not return anything because the query could not
>> be parsed. Where did I do mistake if I did any?
Did you really mean to replace
<http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> by a
variable?
You might as well write:
SELECT ?x ?y WHERE {
?x a ?T1 .
?y a ?T2 .
?v1 ?v2 ?y .
?x ?v3 ?y }
How much data? This query is going to take an extremely long time. If
you added in the inferences in the LUBM then there are a vast number of
"... a ?T" and there is no better starting point.
Andy
>>
>>
>> I have a few modified queries with single variable worked fine however, this
>> one did not. I want to believe
>> the number of variable when is two (X, Y) creating a problem?
>>
>>
>> For your information, I am using Fuseqi server with TDB store.
>>
>> Regards,
>> Rafiq
>
>
>
Re: query
Posted by Joshua TAYLOR <jo...@gmail.com>.
Just because the query is legal SPARQL doesn't mean that it it matches
any of your data? I can send this query to DBpedia, and I get no
results, not because there's no such person, but because DBpedia
doesn't include any data about this person:
select ?person where {
?person a dbpedia-owl:Person ;
foaf:name "Rafiq"@en ;
}
What's your data? Why do you expect your query to work?
On Tue, Jan 7, 2014 at 1:00 PM, Rafiq <ak...@univ-lyon1.fr> wrote:
> Hi,
>
> Here is my query
>
> SELECT ?x ?y WHERE {
> ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Student> .
> ?y <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#Course> .
> <http://www.Department0.University0.edu/AssociateProfessor0>
> <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#teacherOf> ?y .
> ?x <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#takesCourse> ?y
> }
>
> When I execute it I get the answer below:
>
> {
> "head": {
> "vars": [ "x" , "y" ]
> } ,
> "results": {
> "bindings": [
>
> ]
> }
> }
>
> I could not find any valid reason why it returns this answer. I validated
> the query using online validator, its absolutely fine.
> Then I modify the query.. the query turns into the following:
>
> 'SELECT ?x ?y WHERE {?x a ?Student . ?y a ?Course . ?AssociateProfessor0
> ?teacherOf ?y . ?x ?takesCourse ?y}'
>
> I left it two days, it did not return anything because the query could not
> be parsed. Where did I do mistake if I did any?
>
>
> I have a few modified queries with single variable worked fine however, this
> one did not. I want to believe
> the number of variable when is two (X, Y) creating a problem?
>
>
> For your information, I am using Fuseqi server with TDB store.
>
> Regards,
> Rafiq
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/