You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by kumar rohit <ku...@gmail.com> on 2016/04/20 16:23:28 UTC

How to read from file & web in one query

Hello

How can we read a file from Protege and web i-e dbpedia in one SParql query
using Jena code.

Suppose I have subject and predicate from my Protege ontology and Object
from Dbpedia like:

Mod:EiffelTower Mod:resides_In ?var  (?var should be France from Dbpedia
resource)

How can we write the query in Jena? Is it necessary that first we will
import/read the entire Protege file in Jena or some other way exists?

Re: How to read from file & web in one query

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
As Andy suggested, have a look at the documentation of the SPARQL 1.1 
"SERVICE" feature.

> I have one locan ontology from Protege and another I want to query dbpedia
> endpoint. The scenario is something like I have is Subject and property
> from my protege ontology and object which I already imported in Protege is
> from dbpedia.
> Suppose I have
>
> Prefix MO < www.semanticweb/myontology#>
> Prefix dbpedia< http://dbpedia.org/resource/>
>
> select ?obj where { MO:TajMahal MO:locatedIn ?obj}
>
> So Subject/predicate from local ontology and object/instance from dbpedia
>
> regards
>
> On Sat, Apr 23, 2016 at 10:02 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> The SERVICE keyword in SPARQL allows the query to call out to another
>> SPARQL endpoint.
>>
>>          Andy
>>
>>
>> On 20/04/16 15:23, kumar rohit wrote:
>>
>>> Hello
>>>
>>> How can we read a file from Protege and web i-e dbpedia in one SParql
>>> query
>>> using Jena code.
>>>
>>> Suppose I have subject and predicate from my Protege ontology and Object
>>> from Dbpedia like:
>>>
>>> Mod:EiffelTower Mod:resides_In ?var  (?var should be France from Dbpedia
>>> resource)
>>>
>>> How can we write the query in Jena? Is it necessary that first we will
>>> import/read the entire Protege file in Jena or some other way exists?
>>>
>>>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: How to read from file & web in one query

Posted by kumar rohit <ku...@gmail.com>.
I have one locan ontology from Protege and another I want to query dbpedia
endpoint. The scenario is something like I have is Subject and property
from my protege ontology and object which I already imported in Protege is
from dbpedia.
Suppose I have

Prefix MO < www.semanticweb/myontology#>
Prefix dbpedia< http://dbpedia.org/resource/>

select ?obj where { MO:TajMahal MO:locatedIn ?obj}

So Subject/predicate from local ontology and object/instance from dbpedia

regards

On Sat, Apr 23, 2016 at 10:02 PM, Andy Seaborne <an...@apache.org> wrote:

> The SERVICE keyword in SPARQL allows the query to call out to another
> SPARQL endpoint.
>
>         Andy
>
>
> On 20/04/16 15:23, kumar rohit wrote:
>
>> Hello
>>
>> How can we read a file from Protege and web i-e dbpedia in one SParql
>> query
>> using Jena code.
>>
>> Suppose I have subject and predicate from my Protege ontology and Object
>> from Dbpedia like:
>>
>> Mod:EiffelTower Mod:resides_In ?var  (?var should be France from Dbpedia
>> resource)
>>
>> How can we write the query in Jena? Is it necessary that first we will
>> import/read the entire Protege file in Jena or some other way exists?
>>
>>
>

Re: How to read from file & web in one query

Posted by Andy Seaborne <an...@apache.org>.
The SERVICE keyword in SPARQL allows the query to call out to another 
SPARQL endpoint.

	Andy

On 20/04/16 15:23, kumar rohit wrote:
> Hello
>
> How can we read a file from Protege and web i-e dbpedia in one SParql query
> using Jena code.
>
> Suppose I have subject and predicate from my Protege ontology and Object
> from Dbpedia like:
>
> Mod:EiffelTower Mod:resides_In ?var  (?var should be France from Dbpedia
> resource)
>
> How can we write the query in Jena? Is it necessary that first we will
> import/read the entire Protege file in Jena or some other way exists?
>