w3c / csvw

Documents produced by the CSV on the Web Working Group
Other
163 stars 57 forks source link

RDF tests 036 and 037 (tree-ops-ext) don't define @base #386

Closed 6a6d74 closed 9 years ago

6a6d74 commented 9 years ago

Neither of the results for manifest-rdf#test036: tree-ops-ext example nor manifest-rdf#test037: tree-ops-ext minimal define @base.

For example, in test036/result.ttl we have no @base defined, but we do have relative IRIs used; e.g. (snippet)

<http://example.org/tree-ops-ext#gid-1>
  <#on_street> "ADDISON AV" ;
  <#species> "Celtis australis" ;
  <#trim_cycle> "Large Tree Routine Prune"@en ;
  <#dbh> 11 ;
  <#inventory_date> "2010-10-18"^^xsd:date ;
  <#protected> false ;
  <#kml> "<Point><coordinates>-122.156485,37.440963</coordinates></Point>"^^rdf:XMLLiteral .

In test037/result.ttl we have no @base defined, but we do have an prefix defined for IRIs local to the CSV file; e.g. (snippet)

@prefix : <tree-ops-ext.csv#> .

[...]

<http://example.org/tree-ops-ext#gid-1> :dbh 11;
   :inventory_date "2010-10-18"^^xsd:date;
   :kml "<Point><coordinates>-122.156485,37.440963</coordinates></Point>"^^rdf:XMLLiteral;
   :on_street "ADDISON AV";
   :protected false;
   :species "Celtis australis";
   :trim_cycle "Large Tree Routine Prune"@en .

It's odd that different approaches are taken in each case.

I note that the use of a prefix local to the CSV file (e.g. @prefix : ...) is used elsewhere in results: manifest-rdf#test032: events-listing.csv example and manifest-rdf#test033: events-listing.csv minimal output.

Perhaps manifest-rdf#test036: tree-ops-ext example is the odd one out in it's use of relative IRIs?

gkellogg commented 9 years ago

In Turtle, IRIs are relative to the file location, an absolute @base is only necessary if it's something different.

When there's just a single CSV file involved, my serializer will end up defining an empty prefix, which is why you see that in some output. I ended up taking different approaches for examples, either making minimal changes to the example results,mor just using the output of my processor. As these are test results really used for automated testing, rather than as examples, I don't think its too important what is used, but we can use a common approach, if you lke.

gkellogg commented 9 years ago

Another thing, by not defining @base, the tests can be run from an alternate location without changing the expected output. Unfortunately, this can't be done for the JSON output.

6a6d74 commented 9 years ago

Thanks for your pointers ... I see that you've made 036 consistent with the others. Closing issue.