Hi Diogo,

There are a number of different ways how you can do inference over a D2RQ model 
but none of them work very well. In practice, if your data doesn't change too 
often then the easiest route is replicating the database into a triple store 
that supports inference.

I'm not aware of any out-of-the-box approach that works without replicating the 
data *and* performs well.

The easiest way of getting at least some limited inference would be to simply 
modify the D2RQ mapping file to add some additional d2rq:class and 
d2rq:property statements. This can cover at least RDFS inference (domain, 
range, subClassOf, subPropertyOf), and some bits of OWL (equivalentClass, 
equivalentProperty, some cases of union and intersection, perhaps more).

If you only need this to work for a single small ontology, then you could do 
that by hand. The general approach would be to automate it -- write some code 
that reads the ontology, reads the D2RQ mapping, and then augments the D2RQ 
mapping with the appropriate additional constructs. This could probably be 
written in a rules language.

I'd be happy to help a bit with this.

Best,
Richard


On 14 Jan 2011, at 20:37, Diogo FC Patrao wrote:
> My doubt concerns the piece of code found on the page below, section 5.3.2.
> 
> http://sws.ifi.uio.no/semdays2010/05exercises.html
> 
> It simply loads a d2r mapping file, a owl ontology, and answers a sparql 
> query doing inference with pellet (based on rules and axioms present on the 
> owl ontology). d2r mapping points to a mysql database in my desktop, with 4 
> fields, 3 of them indexed.
> 
> So far so good. However, when it does:
> 
> 34:      Model d2rData = new ModelD2RQ(readModel(d2r), null);                
> 45:      ontModel.add(d2rData);
> 
> 
> I think it dumps all data from d2rq and then adds it to the ontology model. 
> That's undesirable, because it took 2G of ram to load, and 5 minutes to run a 
> rather simple query:
> 
> SELECT DISTINCT * 
> {
>   ?s a vocab:pacienteCabecaEPescocoEstadio0.
> } limit 10
> 
> 
> and this class is equivalent to two other classes. I got 8 results, from 3000 
> instances total.
> 
> 
> What I would like to do is to reduce the querying time, and reduce memory 
> consumption (in this order).
> 
> Is there another way to write this code to access d2rq, instead of dumping 
> all data? I mean, I don't know the internals of pellet, but querying the 
> sparql endpoint generated by d2r-server for the expanded query (like above, 
> but specifying the two classes) is so much faster.
> 
> If there isn't, I would like to improve the code so it would be like a 
> server, loading once and answering queries. Would d2r data be out of sync 
> after the mapped database is updated?
> 
> Where do I go now?
> 
> Thanks!!
> 
> 
> 
> 
> Diogo F.C. PatrĂ£o
> Manager of Medical Informatics
> Biotechnology Laboratory
> Hospital A.C. Camargo
> http://www.accamargo.org.br/
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand 
> malware threats, the impact they can have on your business, and how you 
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl_______________________________________________
> d2rq-map-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to