Re: D2RQ Jena plug-in released for treating non-RDF databases as virtual RDF graphs

Hi Stephane,

yes, conditional mappings are definitively a useful feature for D2RQ and using SQL syntax for these conditions seems adequate and straight forward.
We were planning to have a d2rq:additionalWhereClause property on class map level. But you are right, this would also be useful on property bridge level. Maybe we should have a general d2rq:condition, which could be used on class maps or property bridges or both.

>
>Good job ! I was looking forward seeing such tool. I have developed my own branch of 
>mapping tool based on the former D2RM in order to map a complex database. During 
>my development, I have came out with the need to add a precondition to perform a 
>mapping to a property. For example, a property P1 (column) which does not have the 
>information, it may use a conventional null value (for example 0).
>In this case, the mapping of the property is preconditioned by the fact that P1!=0. You 
>may more complex precondition based on Boolean expression using comparator and 
>Boolean operator AND/OR/NOT. Using SQL syntax for this adequate.
>
>The following example show how an ellipsoid mapping can be described.
>An ellipsoid can be described in 3 ways:
>
>1)    (Semi-major axis, semi-minor axis)
>
>The Precondition of mapping to use this case is:
>
>@@SEMI_MINOR_AXIS@@!=0 AND @@ELLIPSOID_SHAPE@@=true
>
>The mapping is the following
>
>  <rdf:Property rdf:about="http://www.isotc211.org/iso19111#semiMinorAxis">
>    <d2r:propertyBridge>
>      <d2r:ObjectPropertyBridge >rdf:about="http://www.pcigeomatics.com/d2r/epsgMapping/ellipsoidSemiMinorPB">
>       <d2r:preCondition>@@SEMI_MINOR_AXIS@@!=0 AND @@ELLIPSOID_SHAPE@@=true</d2r:preCondition>
>        <d2r:belongsToClassMap >rdf:resource="http://www.pcigeomatics.com/d2r/epsgMapping/secondDefiningParameterCM"/>
>        <d2r:refersToClassMap >rdf:resource="http://www.pcigeomatics.com/d2r/epsgMapping/semiMinorLengthMap"/>
>      </d2r:ObjectPropertyBridge>
>    </d2r:propertyBridge>
>  </rdf:Property>
>
> ....
>

Why do you escape @@SEMI_MINOR_AXIS@@ with deliminators? D2RQ doesn't have to parse the conditions, but (as I see it) can include them directly into the created SQL query. This should also work for reversing values. For example, if I have a find(spo) query like

S: ANY
P: ex:privateTelephoneNumber
O: 13456543

and a map like 

:Person rdf:type rdfs:Class;
        d2rq:classMap db1:PersonsClassMap.
db1:PersonsClassMap rdf:type d2rq:ClassMap;
       d2rq:uriColumn "Persons.URI";
       d2rq:dataStorage db1:Database1 .

:privateTelephoneNumber rdf:type rdf:Property ;
            d2rq:propertyBridge db1:PersonsprivateTelephoneNumber       
            .          
db1:PersonsprivateTelephoneNumber rdf:type d2rq:DatatypePropertyBridge ;
            d2rq:column "Persons.PrivateTel" ;
            d2rq:condition "Persons.PublishPrivateTel = true" ;
            d2rq:belongsToClassMap db1:PersonsClassMap 
            .

then the pattern would only fit if there is a PrivateTel 13456543 and the PublishPrivateTel property would be true in the same database record.
Leading us to

SELECT Persons.URI
FROM Persons
WHERE Persons.PrivateTel = '13456543' AND Persons.PublishPrivateTel = true


>I think it would be very useful to get this capability in D2RQ. I would like to align my 
>internal implementation to this implementation provided I get this important capability in the framework.
>

I think we should definitively have conditions in D2RQ V0.2, which is planned to be released in about 4-6 weeks. Richard is still working on the performance test suite which is an seperate package and I think he will not start implementing the D2RQ translation tables before next week.

So, you could start immediately.

Chris


>Your comments are welcome. 
>
>Best regards
>
>Stephane Fellah
>Web Chief Architect
>
>PCI Geomatics
>490, Boulevard St Joseph
>Hull, Quebec
>Canada J8Y 3Y7
>Tel: 1 819 770 0022 Ext. 223
>Fax 1 819 770 0098
>Visit our web site:  www.pcigeomatics.com
>

Received on Tuesday, 22 June 2004 15:48:40 UTC