Closed dtm closed 9 years ago
As a side point pre_88 in the output is:
prefix pre_88 <file:/home/...>
I think the file uri should be file:///home/...
.
This is a perfectly valid rdf file, but does it allow for prov inter-operability? The other prov representations don't have this notion of uri relative to a base uri.
So, how do we handle this? Should we have a base uri parameter for provconvert?
I have implemented a fix, setting a base uri to file://stdin/.
The example now parses in this specific case. However, as said above, we have not solved the interoperability issue here. Should we explicitly disallow relative uris?
As far as the file uri is concerned, it's generated by java.io library. There is very little I can do here.
I added a example file in prov-rdf/src/test/resources/examples/relative-uri.ttl.
If we read the file with
cat prov-rdf/src/test/resources/examples/relative-uri.ttl | provconvert -infile - -informat ttl -outfile - -outformat provn
Then, we get a file://stdin/
as a "base uri".
document
prefix bnode <http://openprovenance.org/provtoolbox/bnode/>
prefix pre_0 <file://stdin/>
prefix ex <http://example.com/>
prefix owl <http://www.w3.org/2002/07/owl#>
prefix rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs <http://www.w3.org/2000/01/rdf-schema#>
activity(ex:experiment,-,-)
entity(ex:inconsistentResult)
wasEndedBy(ex:experiment,ex:inconsistentResult,-,-)
wasEndedBy(ex:experiment,ex:inconsistentResult,-,2011-07-16T01:52:02Z,[prov:location = 'pre_0:scienceLab_003'])
endDocument
If we read the file with
provconvert -infile prov-rdf/src/test/resources/examples/relative-uri.ttl -outfile - -outformat provn
then, we get a base uri file:/home/me/workspace/ProvToolbox/prov-rdf/src/test/resources/examples/
document
prefix bnode <http://openprovenance.org/provtoolbox/bnode/>
prefix pre_0 <file:/home/me/workspace/ProvToolbox/prov-rdf/src/test/resources/examples/>
prefix ex <http://example.com/>
prefix owl <http://www.w3.org/2002/07/owl#>
prefix rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs <http://www.w3.org/2000/01/rdf-schema#>
activity(ex:experiment,-,-)
entity(ex:inconsistentResult)
wasEndedBy(ex:experiment,ex:inconsistentResult,-,-)
wasEndedBy(ex:experiment,ex:inconsistentResult,-,2011-07-16T01:52:02Z,[prov:location = 'pre_0:scienceLab_003'])
endDocument
But this works fine:
Line 44:
I would guess its because we dont have a default base uri defined when we're parsing from a stream as the file based conversion output has pre_88:starting-points.png where pre_88 starts with file:.