Trying to go further writing a mapping file. I need some help to solve my problem.
My mapping file (named org.n3) contains entries like

map:organization_phone a d2rq:PropertyBridge; # EXAMPLE Direct generic relation
     d2rq:belongsToClassMap map:organization;
     d2rq:property s:telephone;
     d2rq:column "coop_local_contact.content";
     d2rq:join "coop_local_organization.id = coop_local_contact.object_id";
d2rq:join "django_content_type.id = coop_local_contact.content_type_id";
     d2rq:condition "coop_local_contact.category = '1'";
     d2rq:condition "django_content_type.model = 'organization'";
     d2rq:condition "coop_local_contact.content <> ''"
     .
map:organization_fax a d2rq:PropertyBridge;
     d2rq:belongsToClassMap map:organization;
     d2rq:property s:faxNumber;
     d2rq:column "coop_local_contact.content";
     d2rq:join "coop_local_organization.id = coop_local_contact.object_id";
d2rq:join "django_content_type.id = coop_local_contact.content_type_id";
     d2rq:condition "coop_local_contact.category = '3'";
     d2rq:condition "django_content_type.model = 'organization'";
     d2rq:condition "coop_local_contact.content <> ''"
     .

Dumping my database in both turtle and xml format, I noticed that the results are not "equal" As Example, I have in tutle
<file:///home/clo/Dev/d2rq/org.tt#org/auvergn_yack/>
a foaf:Agent , geo:Feature , org:Organization , s:Organization ;
      rdfs:label "Auvergn-Yack" ;
       ;
      s:telephone "09.81.99.92.11" ;

and with xml
<rdf:Description rdf:about="#org/auvergn_yack/">
<s:faxNumber>09.81.99.92.11</s:faxNumber>
<s:telephone>09.81.99.92.11</s:telephone>
<rdfs:label>Auvergn-Yack</rdfs:label>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
<rdf:type rdf:resource="http://www.opengis.net/rdf#Feature"/>
<rdf:type rdf:resource="http://schema.org/Organization"/>
<rdf:type rdf:resource="http://www.w3.org/ns/org#Organization"/>
</rdf:Description>

The point with this example, is that the corresponding query (that is the query for theorganization_fax)

SELECT "coop_local_contact"."content" FROM "coop_local_contact", "django_content_type", "coop_local_organization" WHERE ("coop_local_contact"."content_type_id" = "django_content_type"."id" AND "coop_local_contact"."object_id" = "coop_local_organization"."id" AND "coop_local_organization"."slug" = 'auvergn_yack' AND ("coop_local_contact"."category" = '3') AND ("django_content_type"."model" = 'organization'))
returns nothing,
but the one for organization_phone
SELECT "coop_local_contact"."content" FROM "coop_local_contact", "django_content_type", "coop_local_organization" WHERE ("coop_local_contact"."content_type_id" = "django_content_type"."id" AND "coop_local_contact"."object_id" = "coop_local_organization"."id" AND "coop_local_organization"."slug" = 'auvergn_yack' AND ("coop_local_contact"."category" = '1') AND ("django_content_type"."model" = 'organization'))
returns "09.81.99.92.11"

How can I rewrite my mapping file to generate triples only where the query returns something? My turtle file cannot be loaded in a openRdf repository by example (error raised because of the "empty" line, the line with only a ";")
And by the way, why xml and turtle generated files are not "the same"?

Thanks and regards
  Claude Huchet







--
Claude Huchet  -- Coopérative Quinode

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to