R2RML mappings

172 views
Skip to first unread message

Adrian Brasoveanu

unread,
Apr 2, 2014, 6:30:35 AM4/2/14
to ontop...@googlegroups.com
Hello all!

I managed to generate my first set of R2RML mappings with ontop.

I wanted to ask you if there is any method through which I can generate more readable R2RML mappings from the ontop mappings?

All the generated mappings have long GUIDs or long strings that make them really hard to read for human readers at least.

Best regards,
Adrian


Guohui Xiao

unread,
Apr 2, 2014, 7:48:15 AM4/2/14
to Adrian Brasoveanu, ontop...@googlegroups.com
Hi Adrian,

Yes, we do know that the exported R2RML mappings is not pretty. The
reason is that we are using sesame API to output triples representing
the R2RML mappings.
And the output result is, as you said, hard to read.

This situation in Ontop will not change very soon, as we plan use to
integrate another external R2RML API library to replace our
implementation in the summer. Then we will need to see how ontop works
with the new R2RML library.

Meanwhile, I found some alternative ways to output better turtle
syntax [1]. We may try it but I do not want to guarantee for the
moment.

[1] http://sesame-general.435816.n3.nabble.com/TurtleWriter-and-blank-nodes-td4026376.html

Cheers,

Guohui
> --
> 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.



--
Guohui Xiao

Faculty of Computer Science
Free University of Bozen-Bolzano
Piazza Domenicani, 3
I-39100 Bolzano-Bozen BZ, Italy

http://www.ghxiao.org

Adrian Brasoveanu

unread,
Apr 2, 2014, 8:02:39 AM4/2/14
to ontop...@googlegroups.com, Adrian Brasoveanu
Hello Guohui,

Thanks for your answer. I think R2RML is a good investment especially if it's readable:)
The current mappings work, so there's no problem, it's just that it's hard to debug if something's wrong with them.
I think it is ok to add better R2RML mappings at any time.

Keep up the good work!

Best regards,
Adrian

Martín Rezk

unread,
Apr 2, 2014, 8:05:02 AM4/2/14
to Adrian Brasoveanu, ontop...@googlegroups.com
Hi Adrian,
Are you using the ontop Protege plug-in to work with
the R2RML mappings?

Cheers

M.-


On Wed, Apr 2, 2014 at 2:02 PM, Adrian Brasoveanu

Adrian Brasoveanu

unread,
Apr 2, 2014, 8:46:12 AM4/2/14
to Martín Rezk, ontop...@googlegroups.com
Hello Martin,

I used ontop Protege to generate R2RML mappings from some of your tutorial mappings
and from some project mappings to see if it's currently
feasible to work just with the generated mappings as it is a current W3C recommendation, 
but given the fact that they're hard to read I have decided to not use them in the current project.

I think it's much easier to use directly the ontop mappings and custom Java code (where needed,
for example for provenance) and  Pubby or Elda to publish the resulting triples than R2RML for now, 
but I'll certainly be interested to switch to R2RML later (even if in Autumn, after you add the new R2RML 
library that Guohui mentioned.

I only have few weeks to finish current publishing process so it's probably not feasible to try to many 
experimental features.

By the way, has anyone already used ontop to publish RDF Data Cubes?
Is it doable? If it's not doable I will just create mappings for the tables that remain unchanged 
using ontop, and write code for the RDF Data Cubes.

Best regards,
Adrian

Martín Rezk

unread,
Apr 2, 2014, 8:59:03 AM4/2/14
to Adrian Brasoveanu, ontop...@googlegroups.com
Hi Adrian,
>
> I think it's much easier to use directly the ontop mappings and custom Java
> code (where needed,

Cool.


> By the way, has anyone already used ontop to publish RDF Data Cubes?
> Is it doable? If it's not doable I will just create mappings for the tables
> that remain unchanged
> using ontop, and write code for the RDF Data Cubes.

We are not aware of people using ontop for that, but it should be
doable, I don't know much about it, but it is basically RDF isn't it?
So...

Actually, it would be nice if you have some time, you can describe how
you use ontop here
https://github.com/ontop/ontop/wiki/UseCases

So, if someone else wants to work on that they can contact you.


Cheers

M.-

Adrian Brasoveanu

unread,
Apr 2, 2014, 9:53:55 AM4/2/14
to Martín Rezk, ontop...@googlegroups.com
Hello Martin,

I will complete this UseCases page in few days, after I already completed my current task, which hopefully will be done with ontop :)
Good idea to have this UseCases page. 

RDF Data Cubes are typically Turtle files. They have several distinct parts (if you look at this example -
- prefixes 
- data structure definition (which contain dimensions, measures and attributes)
- the dimensions and measures parts
- observations (this is basically the part where ontop would help a lot)
- and some additional instances...(and here as well)

Essentially we modeled the RDF Data Cubes using Protege.
What we still need to do is to fill the observations and additional data instances with data.

Based on what I learned in the last days that seems doable.
There are some questions though:

- How can I remove or take into account the individuals of the ontology when generating triples (is the default behavior
of materializeSesame to not take the individuals into account)? Because there are cases when
I need the individuals from the ontology, and cases when I don't need them, and I don't really
know how to activate/deactivate this when using the batch scripts....

- Is it possible to use data from multiple tables to populate a single individual (a single Observation
for an RDF Data Cube, for example)? I don't remember seeing this, but maybe I overlooked a tutorial....I think this is possible...

- Is there any possibility to create the links to other datasets (DBpedia) directly from the ontop Protege plug-in?
(for countries, for example would be nice to write a SPARQL query that automatically gives you the link to the
same country from DBpedia).

Best regards,
Adrian

Adrian Brasoveanu

unread,
Apr 2, 2014, 1:14:09 PM4/2/14
to Martín Rezk, ontop...@googlegroups.com
Hello Martin,

Thanks. I will try to populate 2-3 data cubes using the ontop Protege plug-in and see what difficulties
I came across.

1) Individuals in the ontology loading - ok, I will look if I need them, and if I don't then I delete them.

2) Regarding your example, yes that was it. I thought for some reason that JOINs are expensive and should
avoid them.

3) Regarding the last part, I was thinking that there is a type of mapping where you can
also use SPARQL queries, as it was called OBDA (Ontology Based Data Access).
I have not seen such examples with ontop though, and it's probably a future feature :)

Keep up the good work.

Best regards,
Adrian


On Wed, Apr 2, 2014 at 8:20 AM, Martín Rezk <marti...@gmail.com> wrote:
> RDF Data Cubes are typically Turtle files. They have several distinct parts
> (if you look at this example -
> http://www.w3.org/TR/2014/REC-vocab-data-cube-20140116/#example is
> implemented in this Turtle file
> http://www.w3.org/TR/2014/REC-vocab-data-cube-20140116/#full-example):
> - prefixes
> - data structure definition (which contain dimensions, measures and
> attributes)
> - the dimensions and measures parts
> - observations (this is basically the part where ontop would help a lot)
> - and some additional instances...(and here as well)

Thanks!


> Based on what I learned in the last days that seems doable.
> There are some questions though:
>
> - How can I remove or take into account the individuals of the ontology when
> generating triples (is the default behavior
> of materializeSesame to not take the individuals into account)? Because
> there are cases when
> I need the individuals from the ontology, and cases when I don't need them,
> and I don't really
> know how to activate/deactivate this when using the batch scripts....

If the individuals are in the owl file they will be loaded.. so do not
have an option to disregard part of the ontology.


> - Is it possible to use data from multiple tables to populate a single
> individual (a single Observation
> for an RDF Data Cube, for example)? I don't remember seeing this, but maybe
> I overlooked a tutorial....I think this is possible...

If I understand correctly what you need, you can use URI templates, for instance

mappingId     Student list
source        SELECT product,  vendor, country FROM product,
countryTable WHERE joinConditionProductCountry
target <http://example.org/{vendor}/{product}/{country}> a :Part .

Then you have two tables in the SQL, and you use both to generate the
URI. If what you need is two populate a concept using two different
tables,
you can have 2 mappings. Does it answer your question?



> - Is there any possibility to create the links to other datasets (DBpedia)
> directly from the ontop Protege plug-in?

Well, you would need a table in your DB with your object, and its
corresponding DBpedia Link, then you can create a data property and
create the link you ask.

Cheers

Martin.-

Guohui Xiao

unread,
Apr 2, 2014, 2:14:27 PM4/2/14
to Adrian Brasoveanu, Martín Rezk, ontop...@googlegroups.com
Hi, Adrian,

On Wed, Apr 2, 2014 at 7:14 PM, Adrian Brasoveanu
<adrian.b...@gmail.com> wrote:
> Hello Martin,
>
> Thanks. I will try to populate 2-3 data cubes using the ontop Protege
> plug-in and see what difficulties
> I came across.
>
> 1) Individuals in the ontology loading - ok, I will look if I need them, and
> if I don't then I delete them.
>
> 2) Regarding your example, yes that was it. I thought for some reason that
> JOINs are expensive and should
> avoid them.

Don't worry too much about the performance.
We have worked years in the ontop systems on producing efficient SQLs
and trying to
eliminate unnecessary joins :)
If your DBs are with proper index / keys, in most cases, Ontop can
generate good SQLs.

>
> 3) Regarding the last part, I was thinking that there is a type of mapping
> where you can
> also use SPARQL queries, as it was called OBDA (Ontology Based Data Access).
> I have not seen such examples with ontop though, and it's probably a future
> feature :)

Yes, ontop is an OBDA system :)
For instance, you can find a complete example (Mapping + Ontology +
SPARQL) in Java:

https://github.com/ontop/ontop-examples/blob/master/src/main/java/org/semanticweb/ontop/examples/QuestOWLExample.java

You can also answering SPARQL queries in the Protege with ontop plugin:

https://github.com/ontop/ontop/wiki/ObdalibPluginQueryTab

Best,

Guohui
Reply all
Reply to author
Forward
0 new messages