Dominique, this is what d2rq:alias is for. See the “Example: Joining a table to itself using d2rq:alias” in the D2RQ manual. Basically you want to declare an alias for the skosxl_concept table, and then use that when joining the target column of the semrelation table.
All the best, Richard On 4 Dec 2011, at 22:33, Dominique Guardiola wrote: > I wonder if this is possible > I have a table (skosxl_concept) relating to itself through another table > managing the many-to-many relation (skosxl_semrelation). > Looks like what i'm trying to do is tricky because when the mapping > references skosxl_concept.id I suppose D2RQ doesn't know which one of the two > "concept" rows we're talking about... > > The following snippet is wrong, my question is : is there a way to achieve > this with D2RQ without modifiying too much the SQL schema ? > > map:concept_sem_relation a d2rq:PropertyBridge; > d2rq:belongsToClassMap map:concept; > d2rq:refersToClassMap map:concept; > d2rq:property skos:broaderTransitive; > d2rq:condition "skosxl_semrelation.type = 0"; > # d2rq:condition "skosxl_concept.id <> skosxl_concept.id" # this is > idiot, ok > d2rq:join "skosxl_semrelation.origin_concept_id => skosxl_concept.id"; > d2rq:join "skosxl_semrelation.target_concept_id => skosxl_concept.id"; > . > > -- > Dominique Guardiola, QUINODE > • http://www.quinode.fr/ > • Tel : 04.27.86.84.37 > • Mob : 06.15.13.22.27 > > > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > d2rq-map-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ d2rq-map-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
