Hi Claude,

This might be a bug in D2RQ. It should produce the same triples in RDF/XML and 
Turtle, and shouldn't produce “empty” Turtle statements. Would you mind raising 
an issue at https://github.com/d2rq/d2rq/issues for this, providing the same 
information as in your mail? We'll then dig into it ASAP.

Also, just to clarify my understanding, are you saying that there should not be 
a fax number in the output data at all, because the SQL query didn't return any 
"coop_local_contact" with "category" 3 (which I suppose means fax)?

Best,
Richard


On 17 Apr 2012, at 17:44, clo wrote:

> 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 the organization_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


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to