Hi Luis,

(I hope you don't mind me sharing this on the mailing list)

On 26 Mar 2012, at 14:26, Luis Ignacio Larrateguy wrote:
> some time ago I wrote an script and a Java class to generate a template 
> mapping file based on an ontology. By reading the class definitions, 
> properties, inverses, etc it created the template allowing the developer to 
> just add the references to the tables in the database.

Right -- so while generate-mapping starts with a database schema and creates a 
skeleton mapping file that references an ad-hoc vocabulary, your code starts 
with an ontology and creates a skeleton mapping file that references an ad-hoc 
database schema.

> I'd like you to take a look if you think it could be useful to reference in 
> the D2RQ project.

What kind of reference do you have in mind?

> As it is, it helped me, but I'm open to suggestions to improve it.

A couple of ideas for improvements:

1. It would help if everything was in English ;-)

2. Most people still use Windows and can't run .sh files; that's why in D2RQ we 
do as much as possible in Java (including things like the help text)

3. It would be nice if the code would retain the original prefix for the 
ontology, e.g,. if you import the FOAF namespace then use foaf: instead of 
vocab: (This can be done by checking the namespace that is defined in the FOAF 
ontology; that's better than asking the user for it IMO)

4. Would be cool if you could make it work *just* with a single URL, so that if 
it's invoked as "generar_mapeo.sh http://xmlns.com/foaf/0.1/"; it will still 
work.

5. Instead of calling the columns all "columnaWithDatatypeProperty", it should 
say something like "Person.name" based on the local names of domain and property

6. Same for the d2rq:joins, it should be "Person.ID = Project.ID" or something 
like that, instead of always "tablaDomain.id = tablaRange.id"

7. The d2rq:uriPattern should really be "Person.ID" instead of 
"tablaPerson.codigo"

8. A good way of sharing this code (much better as an email attachment in the 
crappy SourceForge mailing list archive) would be to create a GitHub project 
for it: http://github.com/ You could even consider creating a fork of the D2RQ 
project http://github.com/d2rq/d2rq and add your code to the fork. This will 
give decent visibility because developers who check out the D2RQ code will 
often look around what's going on in the various forks. It also makes it much 
easier for others to take and copy and improve your code.

Finally, have you seen R2RML? http://www.w3.org/TR/r2rml/ We are planning to 
add R2RML support later this year. The R2RML language differs a bit from the 
D2RQ language because each class map (called rr:TriplesMap in R2RML) is based 
on a single complete SQL query, rather than in D2RQ where we "cut up" the SQL 
query into many small parts (joins, conditions, sqlExpressions and so on). The 
R2RML approach should work well with your scenario, because you can create a 
skeleton TriplesMap that has all PredicateObjectMaps (R2RML's equivalent to our 
property bridges) already created, and the user only has to write a single SQL 
query that returns the correct data.

All the best,
Richard


> The link to the message is below (although it shows as html attachment). I 
> can provide more examples if needed.
> 
> Thanks in advance!
> 
> Luis Larrateguy
> http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTimqPKMYsVvcVoYjSpf2hU5-dy-4fWvYK3M33xe0%40mail.gmail.com&forum_name=d2rq-map-devel
> 
> On Sun, Mar 25, 2012 at 7:22 PM, Richard Cyganiak <[email protected]> wrote:
> Hi Rabi,
> 
> On 22 Mar 2012, at 20:51, Rabi Chandra Shah wrote:
> >              Is it possible to use any custom ontology while mapping the 
> > Relational Database to RDF. We are thinking of using d2rq in our project 
> > for Medical Information System. So far, we have made our ontology, and we 
> > are not able to use this ontology. The only way that i can think of now is 
> > to create our own Customized Mapping file.
> 
> Yes, you can use a custom ontology with D2RQ, and the way to do it is by 
> creating a custom mapping file.
> 
> The D2RQ mapping language is described here:
> http://d2rq.org/d2rq-language
> 
> >              I had a brief look into d2r where i came across java 
> > documentation of the classes provided by them. Can you please give me some 
> > more example on how to use those classes?
> 
> Why do you want to look at Java documentation? You don't need to do anything 
> with Java to customize a mapping file.
> 
> I highly recommend working through the steps described here:
> http://d2rq.org/getting-started
> 
> Best,
> Richard
> 
> 
> 
> >
> >  Thank You,
> >
> > Rabi C Shah
> > IIIT-A , India
> > ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure_______________________________________________
> > d2rq-map-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
> 
> 
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> d2rq-map-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
> 
> 
> 
> -- 
> Luis Larrateguy
> Blog: http://nacho.larrateguy.com.ar/
> Web: http://larrateguy.com.ar/luisignacio


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to