mappingID: placesSource: SELECT freguesia, concelho, distrito FROM localidade, identificacaoEmigrante WHERE identificacaoEmigrante.idNaturalidade = localidade.idLocalidadeTarget: {freguesia} a :E53_Place ; :P89_falls_within {concelho} . {concelho} a :E53_Place ; :P89_falls_within {distrito} . {distrito} a :E53_Place .
OR2) Should I map the places separately?
mappingID: freguesiaSource: SELECT freguesia FROM localidade, identificacaoEmigrante WHERE identificacaoEmigrante.idNaturalidade = localidade.idLocalidadeTarget: {freguesia} a :E53_Place ; :P89_falls_within :E53_Place .
Repeating the same to concelho and distrito.
Here arises the second doubt, for example: how can I query (SPARQL) a list of all freguesias (parish), concelhos (council) and distritos (district)?
SELECT ?f ?c ?dWHERE { ?f a :E53_Place ; :P89_falls_within ?c .?c a :E53_Place ; :P89_falls_within ?d .?d a :E53_Place . }
Notice that exist another tables in my database describing persons (not only identificacaoEmigrante), so, I didn't want to map identificacaoEmigrante just as {idEmigrante} a :E21_Person like this example. The identificacaoEmigrante mapping should include another concept (E9 Move) of my ontology that describes the emigration movement event. Thus, what identifies an emigrant is already having participated in an emigration movement.
Sorry for the very extensive question, but I wanted to detail as much as possible :)
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
mappingID: placesSource: SELECT freguesia, concelho, distrito FROM localidade, identificacaoEmigrante WHERE identificacaoEmigrante.idNaturalidade = localidade.idLocalidadeTarget: {freguesia} a :E53_Place ; :P89_falls_within {concelho} . {concelho} a :E53_Place ; :P89_falls_within {distrito} . {distrito} a :E53_Place .
Another remark: why don't you extend this ontology but adding your own concepts of Emigrant, Parish, Council and District?
These would be subclasses of the classes you are currently using in your mappings.
Having such subclasses would be helpful for querying your data.
OR2) Should I map the places separately?
mappingID: freguesiaSource: SELECT freguesia FROM localidade, identificacaoEmigrante WHERE identificacaoEmigrante.idNaturalidade = localidade.idLocalidadeTarget: {freguesia} a :E53_Place ; :P89_falls_within :E53_Place .
Repeating the same to concelho and distrito.
As you prefer, it is the same for Ontop. It is usually better not have too many triples in the target part.
Here arises the second doubt, for example: how can I query (SPARQL) a list of all freguesias (parish), concelhos (council) and distritos (district)?
SELECT ?f ?c ?dWHERE { ?f a :E53_Place ; :P89_falls_within ?c .?c a :E53_Place ; :P89_falls_within ?d .?d a :E53_Place . }
As I said before, you would have better to use the classes Parish, Council and District instead of :E53_Place .
Note that saying that ?f ?c ?d are instances of :E53_Place is useless because :E53_Place is the domain and the range of the property :P89_falls_within .
Notice that exist another tables in my database describing persons (not only identificacaoEmigrante), so, I didn't want to map identificacaoEmigrante just as {idEmigrante} a :E21_Person like this example. The identificacaoEmigrante mapping should include another concept (E9 Move) of my ontology that describes the emigration movement event. Thus, what identifies an emigrant is already having participated in an emigration movement.
Sorry for the very extensive question, but I wanted to detail as much as possible :)
Thanks in advance.
Best,
Benjamin
--
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "ontop4obda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ontop4obda/qPjWyyPQ17k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ontop4obda+...@googlegroups.com.
Hi Ricardo,
let me try to answer your questions.
A) For your first question, the answer is to separate them. AFAIK -ontop- mappings must have only 1 subject map. What I mean by subject map is the rdf:type or the ‘a’ class definition. So in your first example, you should not have the definition of :E21_Person and :E82_Actor_Appellation in the same mapping. The rest of your ‘Target’ schema is the predicate-object map which can be zero or many. These maps are the data or object properties that belong to the initial subject class.
One thing to note is that you should put a prefix after your column-variable assignment, especially when you are working with class and object property assertions.
For example, the right syntax to write is:
Example 1::{idEmigrante} a :E21_Person ; :P131_is_identified_by {nome}
Example 2::{freguesia} a :E53_Place ; :P89_falls_within :{concelho}
B) Now here comes the tricky part of developing the mappings (related to your second and third question).
Before we get into your SPARQL query test, I suggest you to rewrite the places mappings as follow:
MappingID: PlacesSource: SELECT idLocalidade, freguensa FROM localidadeTarget: :{idLocalidade} a :E53_Place ; :P89_falls_within :freguensia/{freguensa} .
MappingID: ParishSource: SELECT freguensa, concelho FROM localidadeTarget: :freguensia/{frequensa} a :E53_Place ; :P89_falls_within :concelho/{concelho} .
MappingID: CouncilSource: SELECT concelho, distrito FROM localidadeTarget: :concelho/{concelho} a :E53_Place ; :P89_falls_within :distrito/{distrito} .
MappingID: DistrictSource: SELECT district FROM localizedTarget: :distrito/{distrito} a :E53_Place .
Testing queries:
SELECT DISTINCT ?x WHERE {?x a :E53_Place . # Will show all places IRI defined in the mappings, i.e., Places, Parish, Council, District}
SELECT DISTINCT ?x ?y WHERE {?x :P89_falls_within ?y . # Will show the city administration hierarchy}
(Notice the strategy that I used to have the IRI template unique and more informative for each Localidade, Freguensa, Concelho, and Distrito; and also notice I didn’t use JOIN table in the source query. I think the best practice of creating OBDA model (i.e., the mappings) is to avoid join table expressions and let the reasoner formulates the joining when it translates SPARQL queries to SQL.
C) If you have another information about the :E21_Person class then just create a new one. So for example, you have that information in another table, say, table X
MappingID: Person in Table XSource: SELECT personID FROM XTarget: :{personID} a :E21_Person .
The consequence is that when you query SELECT ?x WHERE { ?x a :E21_Person . } the -ontop- reasoner will collect the answer from both tables. But note that in case you know table X doesn’t give you new information about Person (for example, the data is actually just a foreign key from the “master table" identificacaoEmigrante) then I suggest you don’t need to create a new mapping. Creating a new class definition mapping (or subject map) should only be done when you have different table sources that would give you different (or new) information. It will make your model less complicated.
Hope my answers can help. They are quite long and hopefully you won’t get lost :)
Cheers!
/Josef
PS. There might be errors if you just copy-and-paste everything since I haven’t tested these mappings. Just an illustration from what I understand of the system.
On Oct 14, 2015, at 2:17 AM, Ricardo G. Martini <giulian...@gmail.com> wrote:
Hi,
I have some doubts about ontop mapping and what's the better way to map my source.If someone already worked with ontop, please, help me.
--
You received this message because you are subscribed to a topic in the Google Groups "ontop4obda" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ontop4obda/qPjWyyPQ17k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ontop4obda+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Ricardo G. Martini, MsC.
---------------------------------------------------------------------------
Doutorando em Informática
Programa Doutoral em Informática (PDInf)Centro Algoritmi
Universidade do Minho (UMinho) - Braga, Portugal
Mestre em Computação - Universidade Federal de Santa Maria (UFSM)Santa Maria, RS, Brasil
Lattes CV: http://lattes.cnpq.br/8710772034085679
---------------------------------------------------------------------------
_______________________________________________
protege-user mailing list
proteg...@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
proteg...@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-user
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.