
Hi,
on how to write mappings, I suggest reading this excellent book
(for a more practical perspective, not focused on VKGs though):
https://link.springer.com/chapter/10.1007/978-3-031-01916-6_3
or reading this article (for a more foundational perspective,
focused on mappings for VKGs):
https://authors.elsevier.com/a/1gn1J,3rzWzLDk
Coming to your example, on top of the suggestion by Martin I just
add that, if you want to preserve the semantics of the original
database, that is, if you do not want to lose those information
about those services with no servers assigned, you need a further
mapping only creating services (and their titles). Hence, the
specification would become something like:
mappingId Service
target :ontologyName/service/{id} a :Service ; :title
{title}^^xsd:string .
source SELECT id, title FROM service
mappingId Server
target :ontologyName/server/{id} a :Server; :basePath
{base_path}^^xsd:string .
source SELECT id, base_path FROM server
mappingId hasBasePath
target :ontologyName/service/{service_id} :hasBasePath :
ontologyName/server/{id} .
source SELECT id, service_id FROM server
Note that I have omitted the SQL join in the last mapping, which
is redundant, and that the second and third mapping can in fact be
merged into a single mapping (since they have the same logical
table).
Best, Davide.
Hi,
on how to write mappings, I suggest reading this excellent book
(for a more practical perspective, not focused on VKGs though):
https://link.springer.com/chapter/10.1007/978-3-031-01916-6_3
or reading this article (for a more foundational perspective,
focused on mappings for VKGs):
https://authors.elsevier.com/a/1gn1J,3rzWzLDk
Coming to your example, on top of the suggestion by Martin I just
add that, if you want to preserve the semantics of the original
database, that is, if you do not want to lose those information
about those services with no servers assigned, you need a further
mapping only creating services (and their titles). Hence, the
specification would become something like:
mappingId Service
target :ontologyName/service/{id} a :Service ; :title
{title}^^xsd:string .
source SELECT id, title FROM service
mappingId Server
target :ontologyName/server/{id} a :Server; :basePath
{base_path}^^xsd:string .
source SELECT id, base_path FROM server
mappingId hasBasePath
target :ontologyName/service/{service_id} :hasBasePath :
ontologyName/server/{id} .
source SELECT id, service_id FROM server
Note that I have omitted the SQL join in the last mapping, which
is redundant, and that the second and third mapping can in fact be
merged into a single mapping (since they have the same logical
table).
Best, Davide.
--
Please follow our guidelines on how to report a bug https://ontop-vkg.org/community/contributing/bug-report
---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ontop4obda/712681b5-ea11-4bd3-9973-7b119bc9bcddn%40googlegroups.com.