On 12/29/15 2:08 PM, Eng.Bassam wrote: > thanks > I thinks only must write FROM statement to include local ontologies in > my sparql or to inform sparql engine where can locate the data, i.e: > > select ?o ?cname > FROM <http://localhost:8890/ontologies/mydata> //my persons data > FROM <http://localhost:8890/ontologies/geonames> // geo country data > where {?s SIO:SIO_000664 ?o; > ?s a foaf:Person. > OPTIONAL { ?o gn:name ?cname. } > } > limit 10 > > right?
You can also just do:
select ?o ?cname
where { GRAPH ?g { ?s SIO:SIO_000664 ?o;
?s a foaf:Person.
OPTIONAL { ?o gn:name ?cname. } }
}
limit 10
Kingsley
>
> On Tue, Dec 29, 2015 at 9:02 PM, Kingsley Idehen
> <[email protected] <mailto:[email protected]>> wrote:
>
> On 12/29/15 12:46 PM, Eng.Bassam wrote:
>> suppose the geoname resource is:
>> <gn:Feature rdf:about="http://sws.geonames.org/2378080/">
>> <rdfs:isDefinedBy
>> rdf:resource="http://sws.geonames.org/2378080/about.rdf"/>
>> <gn:name>Mauritania</gn:name>
>> </gn:Featue>
>>
>> I want to get name of country_geo
>> select ?o ?cname
>> where {?s SIO:SIO_000664 ?o;
>> ?s a foaf:Person.
>> ?o gn:name ?cname }
>> limit 10
>>
>> how I can traverse to geonames ontology to get a name property ???
>
> That has nothing to do with R2RML. That's all about de-referencing
> data from geonames "on the fly" as part of query processing -- if
> you don't have this data loaded locally. If loaded locally, then
> query above will return the correct solution for ?cname.
>
> To be extra safe (i.e. query for a solution that includes
> relations that have empty gname objects) try:
>
> select ?o ?cname
> where {?s SIO:SIO_000664 ?o;
> ?s a foaf:Person.
> OPTIONAL { ?o gn:name ?cname. }
> }
> limit 10
>
> Kingsley
>>
>>
>> On Tue, Dec 29, 2015 at 6:36 PM, Kingsley Idehen
>> <[email protected] <mailto:[email protected]>> wrote:
>>
>> On 12/29/15 8:31 AM, Eng.Bassam wrote:
>>> Hello
>>> I have a person pesron table with columns (id, name ,
>>> country_geo), person table type in R2RML is foaf:person, I
>>> have also loaded geonames onology in my virtuoso server at
>>> link http://localhost:8890/ontologies/geonames
>>>
>>> now for the country_geo column the r2rml is :
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant
>>> SIO:SIO_000664 ] ; rr:objectMap [ rr:column "Country_geo" ]; ] ;
>>>
>>> the value of country_geo is IRI e.g
>>> "http://sws.geonames.org/2378080/" described in my loaded
>>> ontology geonames.
>>> now how can I make the generated country_geo property in
>>> person refer to my loaded ontology geonames, what should I
>>> write in r2rml ???
>>> my objective is making sparql queries on the generated views
>>> (persons) and traverse to geonames for more info about
>>> countries.
>>>
>>> wish it's clear question :)
>>> thanks
>>>
>>> --
>>> -----------------------------------
>>> > Eng.Bassam Najeeb.
>>> >Software Engineer.
>>
>> Okay, so have you generated you views and hit a problem? You
>> are already mapping Geoname IRIs to country_geo, so your end
>> product would be instances of a class that have IRI property
>> values from the geonames ontology. Net effect, from your
>> SPARQL DESCRIBE, SELECT, or CONSTRUCTs on the foaf:Person
>> instances you will be able to follow-your-nose through
>> SIO:SIO_000664 property values.
>>
>> select ?o
>> where {?s SIO:SIO_000664 ?o;
>> ?s a foaf:Person. }
>> limit 10
>>
>>
>> Kingsley
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> Virtuoso-users mailing list
>>> [email protected]
>>> <mailto:[email protected]>
>>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>>
>>
>> --
>> Regards,
>>
>> Kingsley Idehen
>> Founder & CEO
>> OpenLink Software
>> Company Web: http://www.openlinksw.com
>> Personal Weblog 1: http://kidehen.blogspot.com
>> Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
>> <http://www.openlinksw.com/blog/%7Ekidehen>
>> Twitter Profile: https://twitter.com/kidehen
>> Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
>> LinkedIn Profile: http://www.linkedin.com/in/kidehen
>> Personal WebID:
>> http://kingsley.idehen.net/dataspace/person/kidehen#this
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Virtuoso-users mailing list
>> [email protected]
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>>
>>
>>
>>
>> --
>> -----------------------------------
>> > Eng.Bassam Najeeb.
>> >Software Engineer.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> Virtuoso-users mailing list
>> [email protected]
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
> --
> Regards,
>
> Kingsley Idehen
> Founder & CEO
> OpenLink Software
> Company Web: http://www.openlinksw.com
> Personal Weblog 1: http://kidehen.blogspot.com
> Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
> <http://www.openlinksw.com/blog/%7Ekidehen>
> Twitter Profile: https://twitter.com/kidehen
> Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn Profile: http://www.linkedin.com/in/kidehen
> Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>
>
> --
> -----------------------------------
> > Eng.Bassam Najeeb.
> >Software Engineer.
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
--
Regards,
Kingsley Idehen
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this
smime.p7s
Description: S/MIME Cryptographic Signature
------------------------------------------------------------------------------
_______________________________________________ Virtuoso-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
