On 12/30/15 8:21 AM, Eng.Bassam wrote: > Hi Kingsely and all members > > still there is the same problem can't traverse from ontology to other > cause the generated IRI is text not IRI type, next is the description > and sorry to be long but it's a problem need to solve ASAP to > complete my project > As I have said I have imported SQL DB using custom R2RML: > <#TriplesMapPerson> a rr:TriplesMap; rr:logicalTable [ rr:tableSchema > "dataMaster" ; rr:tableOwner "data-ODBC" ; rr:tableName "Person" ]; > rr:subjectMap [ rr:termType rr:IRI ; rr:template > "http://localhost:8890/dataMaster/person/PersonID={ID} > <http://localhost:8890/dataMaster/person/PersonID=%7BID%7D>"; rr:class > sio:SIO_000393; rr:graph <http://localhost:8890/dataMaster#> ]; > > rr:predicateObjectMap [ rr:predicateMap [ rr:constant sio:SIO_000664 ] > ; rr:objectMap [ rr:column "Country" ]; ] ; > > the column Country contain the IRIs of country geo ontology i.e as > http://sws.geonames.org/226074/, this ontology I have loaded in my > Virtuoso server at > http://localhost:8890/ontologies/geonames > > this local ontology have rdf resources as : > <gn:Feature rdf:about="http://sws.geonames.org/226074/ > <http://sws.geonames.org/2378080/>"> > <rdfs:isDefinedBy > rdf:resource="http://sws.geonames.org/226074/about.rdf > <http://sws.geonames.org/2378080/about.rdf>"/> > <gn:name>USA</gn:name> > </gn:Featue> > > now my query is : > > PREFIX sio: <http://semanticscience.org/resource/> > prefix gn: <http://www.geonames.org/ontology#> > select ?country > FROM <http://localhost:8890/dataMaster#> > FROM <http://localhost:8890/ontologies/geonames> > WHERE { ?s a sio:SIO_000393. > ?s sio:SIO_000664 ?country. > } > > the result unfortunately is the IRIs but in quotation as a text not an > IRI type i.e "http://sws.geonames.org/226074/", so I can't add to > where clause in my query ?country gn:name ?cname also can't do > ?country a gn:Feature > > PREFIX sio: <http://semanticscience.org/resource/> > prefix gn: <http://www.geonames.org/ontology#> > select ?country > FROM <http://localhost:8890/dataMaster#> > FROM <http://localhost:8890/ontologies/geonames> > WHERE { ?s a sio:SIO_000393. > ?s sio:SIO_000664 ?country. > ?country gn:name ?cname // *this > triple make a traverse to other local ontology (geonames)* > } > > I think the problem is : > generated country property is text not IRI type. > I have try to modify the my R2RML using IRI template as > rr:predicateObjectMap [ rr:predicateMap [ rr:constant sio:SIO_000664 ] > ; rr:objectMap [ rr:termType rr:IRI ; rr:constant gn:Feature; > rr:template "{Country_geo}" ]; ] ; > > but also fail the generated IRI "need an > encoding"as http%3A%2F%2Fsws.geonames.org%2F226074%2F > <http://localhost:8890/conductor/http%3A%2F%2Fsws.geonames.org%2F226074%2F> > > wish to give me a solution :) > > thanks
You don't need an encoded IRI. You need <http://sws.geonames.org/226074/ <http://sws.geonames.org/2378080/>> . rr:predicateObjectMap [ rr:predicateMap [ rr:constant sio:SIO_000664 ] ; rr:objectMap [ rr:termType rr:IRI ; rr:constant gn:Feature; rr:template "{Country_geo}" ]; ] should be producing <http://sws.geonames.org/226074/ <http://sws.geonames.org/2378080/>>, not "http://sws.geonames.org/226074/ <http://sws.geonames.org/2378080/>" . We'll try to make time to simulate this if my response still doesn't get you over this problem. Kingsley > > > On Tue, Dec 29, 2015 at 9:46 PM, Kingsley Idehen > <kide...@openlinksw.com <mailto:kide...@openlinksw.com>> wrote: > > 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 >> <kide...@openlinksw.com <mailto:kide...@openlinksw.com>> 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 >>> <kide...@openlinksw.com <mailto:kide...@openlinksw.com>> 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 >>>> Virtuoso-users@lists.sourceforge.net >>>> <mailto:Virtuoso-users@lists.sourceforge.net> >>>> 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 >>> Virtuoso-users@lists.sourceforge.net >>> <mailto:Virtuoso-users@lists.sourceforge.net> >>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users >>> >>> >>> >>> >>> -- >>> ----------------------------------- >>> > Eng.Bassam Najeeb. >>> >Software Engineer. >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> Virtuoso-users mailing list >>> Virtuoso-users@lists.sourceforge.net >>> <mailto:Virtuoso-users@lists.sourceforge.net> >>> 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 >> Virtuoso-users@lists.sourceforge.net >> <mailto:Virtuoso-users@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/virtuoso-users >> >> >> >> >> -- >> ----------------------------------- >> > Eng.Bassam Najeeb. >> >Software Engineer. >> >> >> >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Virtuoso-users mailing list >> Virtuoso-users@lists.sourceforge.net >> <mailto:Virtuoso-users@lists.sourceforge.net> >> 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 > Virtuoso-users@lists.sourceforge.net > <mailto:Virtuoso-users@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/virtuoso-users > > > > > -- > ----------------------------------- > > Eng.Bassam Najeeb. > >Software Engineer. > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Virtuoso-users mailing list > Virtuoso-users@lists.sourceforge.net > 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 Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users