conversion to dot for association without agent #67

Closed
lucmoreau opened this Issue Jan 17, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@lucmoreau
Owner

lucmoreau commented Jan 17, 2013

Conversion fails when agent is absent in association. See Simon's example:

@Prefix prov: http://www.w3.org/ns/prov# .
@Prefix ex: http://www.inf.kcl.ac.uk/staff/simonm/provoking# .
@Prefix dcterms: http://purl.org/dc/terms/ .
@Prefix foaf: http://xmlns.com/foaf/0.1/ .
@Prefix xsd: http://www.w3.org/2001/XMLSchema# .

ex:article-hc2551rz-1 a prov:Entity .
ex:article-hc2551rz-1 dcterms:title "Crime rises in cities"^^xsd:string.
ex:composition-hc2551rz-2 a prov:Entity .
ex:composition-hc2551rz-2 prov:wasGeneratedBy ex:compose-hc2551rz-3 .
ex:composition-hc2551rz-2 prov:qualifiedGeneration _:b1 .
_:b1 prov:activity ex:compose-hc2551rz-3 .
_:b1 prov:hadRole ex:composedData .
_:b1 a prov:Generation .
ex:compose-hc2551rz-3 a prov:Activity .
ex:compose-hc2551rz-3 prov:used ex:dataSet1-hc2551rz-4 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:b2 .
_:b2 prov:entity ex:dataSet1-hc2551rz-4 .
_:b2 prov:hadRole ex:dataToCompose .
_:b2 a prov:Usage .
ex:dataSet1-hc2551rz-4 a prov:Entity .
ex:compose-hc2551rz-3 prov:used ex:regionList-hc2551rz-5 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:b3 .
_:b3 prov:entity ex:regionList-hc2551rz-5 .
_:b3 prov:hadRole ex:regionsToAggregateBy .
_:b3 a prov:Usage .
ex:regionList-hc2551rz-5 a prov:Entity .
ex:chart1-hc2551rz-6 a prov:Entity .
ex:chart1-hc2551rz-6 prov:wasGeneratedBy ex:illustrate-hc2551rz-7 .
ex:illustrate-hc2551rz-7 a prov:Activity .
ex:illustrate-hc2551rz-7 prov:used ex:composition-hc2551rz-2 .
ex:derek-hc2551rz-8 a prov:Agent .
ex:derek-hc2551rz-8 a prov:Person .
ex:derek-hc2551rz-8 foaf:mbox mailto:derek@example.org .
ex:derek-hc2551rz-8 foaf:givenName "Derek"^^xsd:string.
ex:derek-hc2551rz-8 prov:actedOnBehalfOf ex:chartgen-hc2551rz-9 .
ex:chartgen-hc2551rz-9 a prov:Agent .
ex:chartgen-hc2551rz-9 a prov:Organization .
ex:chartgen-hc2551rz-9 foaf:name "Chart Generators Inc"^^xsd:string.
ex:chart1-hc2551rz-6 prov:wasAttributedTo ex:derek-hc2551rz-8 .
ex:composedData a prov:Role .
ex:dataToCompose a prov:Role .
ex:regionsToAggregateBy a prov:Role .
ex:analyst a prov:Role .
ex:dataSet2-hc2551rz-10 a prov:Entity .
ex:dataSet2-hc2551rz-10 prov:wasRevisionOf ex:dataSet1-hc2551rz-4 .
ex:dataSet2-hc2551rz-10 prov:wasDerivedFrom ex:dataSet1-hc2551rz-4 .
ex:chart2-hc2551rz-11 a prov:Entity .
ex:chart2-hc2551rz-11 prov:wasDerivedFrom ex:dataSet2-hc2551rz-10 .
ex:chart2-hc2551rz-11 prov:wasRevisionOf ex:chart1-hc2551rz-6 .
ex:chart2-hc2551rz-11 prov:wasDerivedFrom ex:chart1-hc2551rz-6 .
ex:correct-hc2551rz-12 prov:startedAtTime "2012-03-31T09:21:00+01:00"^^xsd:dateTime.
ex:correct-hc2551rz-12 prov:endedAtTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime.
ex:correct-hc2551rz-12 a prov:Activity .
ex:correct-hc2551rz-12 prov:qualifiedAssociation _:b4 .
_:b4 prov:hadPlan ex:instructions-hc2551rz-14 .
_:b4 a prov:Association .
ex:edith-hc2551rz-13 a prov:Agent .
ex:edith-hc2551rz-13 a prov:Person .
ex:instructions-hc2551rz-14 a prov:Entity .
ex:instructions-hc2551rz-14 a prov:Plan .
ex:dataSet2-hc2551rz-10 prov:wasGeneratedBy ex:correct-hc2551rz-12 .
ex:chart1-hc2551rz-6 prov:wasGeneratedBy ex:compile1-hc2551rz-15 .
ex:chart1-hc2551rz-6 prov:qualifiedGeneration _:b5 .
_:b5 prov:activity ex:compile1-hc2551rz-15 .
_:b5 prov:atTime "2012-03-02T10:30:00Z"^^xsd:dateTime.
_:b5 a prov:Generation .
ex:compile1-hc2551rz-15 a prov:Activity .
ex:chart2-hc2551rz-11 prov:wasGeneratedBy ex:compile2-hc2551rz-16 .
ex:chart2-hc2551rz-11 prov:qualifiedGeneration _:b6 .
_:b6 prov:activity ex:compile2-hc2551rz-16 .
_:b6 prov:atTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime.
_:b6 a prov:Generation .
ex:compile2-hc2551rz-16 a prov:Activity .
ex:blogEntry-hc2551rz-17 a prov:Entity .
ex:blogEntry-hc2551rz-17 prov:wasQuotedFrom ex:article-hc2551rz-1 .
ex:blogEntry-hc2551rz-17 prov:wasDerivedFrom ex:article-hc2551rz-1 .
ex:articleV1-hc2551rz-18 a prov:Entity .
ex:articleV1-hc2551rz-18 prov:specializationOf ex:article-hc2551rz-1 .
ex:articleV2-hc2551rz-19 a prov:Entity .
ex:articleV2-hc2551rz-19 prov:specializationOf ex:article-hc2551rz-1 .
ex:articleV2-hc2551rz-19 prov:alternateOf ex:articleV1-hc2551rz-18 .

@mikejewell

This comment has been minimized.

Show comment
Hide comment
@mikejewell

mikejewell Jan 18, 2013

Contributor

Conversion seems to be ok here, unless I'm missing a triple somewhere! I took the output from reading the ttl and writing it back out and then rearranged it to match the original - the association bit itself looks like:

ex:correct-hc2551rz-12 a prov:Activity ;
    prov:startedAtTime "2012-03-31T09:21:00+01:00"^^xsd:dateTime ;
    prov:endedAtTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .
ex:correct-hc2551rz-12 prov:qualifiedAssociation _:blank14 .

_:blank14 a prov:Association .
_:blank14 prov:hadPlan ex:instructions-hc2551rz-14 .

The full output is:

@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix bnode: <http://openprovenance.org/provtoolbox/bnode/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ns177681887: <file:/home/moj/Development/workspace/ProvToolbox/prov-rdf/src/test/resources/issues/> .
@prefix ex: <http://www.inf.kcl.ac.uk/staff/simonm/provoking#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ns-306161376: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:article-hc2551rz-1 a prov:Entity ;
    dcterms:title "Crime rises in cities"^^xsd:string .

ex:composition-hc2551rz-2 a prov:Entity .
ex:composition-hc2551rz-2 prov:wasGeneratedBy ex:compose-hc2551rz-3 .
ex:composition-hc2551rz-2 prov:qualifiedGeneration _:blank11 .

_:blank11 a prov:Generation ;
    prov:activity ex:compose-hc2551rz-3 .
_:blank11 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#composedData"^^xsd:string .

ex:dataSet1-hc2551rz-4 a prov:Entity .

ex:compose-hc2551rz-3 a prov:Activity .
ex:compose-hc2551rz-3 prov:used ex:dataSet1-hc2551rz-4 , ex:regionList-hc2551rz-5 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:blank12 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:blank13 .

_:blank12 a prov:Usage ;
    prov:entity ex:dataSet1-hc2551rz-4 .
_:blank12 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#dataToCompose"^^xsd:string .

_:blank13 a prov:Usage ;
    prov:entity ex:regionList-hc2551rz-5 .
_:blank13 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#regionsToAggregateBy"^^xsd:string .

ex:regionList-hc2551rz-5 a prov:Entity .

ex:chart1-hc2551rz-6 a prov:Entity .
ex:chart1-hc2551rz-6 prov:wasGeneratedBy ex:illustrate-hc2551rz-7 ;
    prov:wasAttributedTo ex:derek-hc2551rz-8 ;
    prov:wasGeneratedBy ex:compile1-hc2551rz-15 .
ex:chart1-hc2551rz-6 prov:qualifiedGeneration _:blank15 .

ex:illustrate-hc2551rz-7 a prov:Activity .
ex:illustrate-hc2551rz-7 prov:used ex:composition-hc2551rz-2 .

ex:derek-hc2551rz-8 a prov:Agent , prov:Person ;
    foaf:mbox <file:/home/moj/Development/workspace/ProvToolbox/prov-rdf/src/test/resources/issues/derek@example.org> ;
    foaf:givenName "Derek"^^xsd:string .
ex:derek-hc2551rz-8 prov:actedOnBehalfOf ex:chartgen-hc2551rz-9 .

ex:chartgen-hc2551rz-9 a prov:Agent , prov:Organization ;
    foaf:name "Chart Generators Inc"^^xsd:string .

ex:dataSet2-hc2551rz-10 a prov:Entity .
ex:dataSet2-hc2551rz-10 prov:qualifiedRevision _:blank8 ;
    prov:wasDerivedFrom ex:dataSet1-hc2551rz-4 ;
    prov:wasGeneratedBy ex:correct-hc2551rz-12 .
_:blank8 a prov:Revision ;
    prov:entity ex:dataSet1-hc2551rz-4 .

ex:chart2-hc2551rz-11 a prov:Entity .
ex:chart2-hc2551rz-11 prov:wasDerivedFrom ex:dataSet2-hc2551rz-10 .
ex:chart2-hc2551rz-11 prov:qualifiedRevision _:blank9 ;
    prov:wasDerivedFrom ex:chart1-hc2551rz-6 ;
    prov:wasGeneratedBy ex:compile2-hc2551rz-16 .
ex:chart2-hc2551rz-11 prov:qualifiedGeneration _:blank16 .
_:blank9 a prov:Revision ;
    prov:entity ex:chart1-hc2551rz-6 .

ex:correct-hc2551rz-12 a prov:Activity ;
    prov:startedAtTime "2012-03-31T09:21:00+01:00"^^xsd:dateTime ;
    prov:endedAtTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .
ex:correct-hc2551rz-12 prov:qualifiedAssociation _:blank14 .

_:blank14 a prov:Association .
_:blank14 prov:hadPlan ex:instructions-hc2551rz-14 .

ex:edith-hc2551rz-13 a prov:Agent , prov:Person .

ex:instructions-hc2551rz-14 a prov:Entity , prov:Plan .

_:blank15 a prov:Generation ;
    prov:activity ex:compile1-hc2551rz-15 .
_:blank15 prov:atTime "2012-03-02T10:30:00Z"^^xsd:dateTime .

ex:compile1-hc2551rz-15 a prov:Activity .

_:blank16 a prov:Generation ;
    prov:activity ex:compile2-hc2551rz-16 .
_:blank16 prov:atTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .

ex:compile2-hc2551rz-16 a prov:Activity .

ex:blogEntry-hc2551rz-17 a prov:Entity .
ex:blogEntry-hc2551rz-17 prov:qualifiedQuotation _:blank10 ;
    prov:wasDerivedFrom ex:article-hc2551rz-1 .
_:blank10 a prov:Quotation ;
    prov:entity ex:article-hc2551rz-1 .


ex:articleV1-hc2551rz-18 a prov:Entity .
ex:articleV1-hc2551rz-18 prov:specializationOf ex:article-hc2551rz-1 .

ex:articleV2-hc2551rz-19 a prov:Entity .
ex:articleV2-hc2551rz-19 prov:specializationOf ex:article-hc2551rz-1 ;
    prov:alternateOf ex:articleV1-hc2551rz-18 .
Contributor

mikejewell commented Jan 18, 2013

Conversion seems to be ok here, unless I'm missing a triple somewhere! I took the output from reading the ttl and writing it back out and then rearranged it to match the original - the association bit itself looks like:

ex:correct-hc2551rz-12 a prov:Activity ;
    prov:startedAtTime "2012-03-31T09:21:00+01:00"^^xsd:dateTime ;
    prov:endedAtTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .
ex:correct-hc2551rz-12 prov:qualifiedAssociation _:blank14 .

_:blank14 a prov:Association .
_:blank14 prov:hadPlan ex:instructions-hc2551rz-14 .

The full output is:

@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix bnode: <http://openprovenance.org/provtoolbox/bnode/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ns177681887: <file:/home/moj/Development/workspace/ProvToolbox/prov-rdf/src/test/resources/issues/> .
@prefix ex: <http://www.inf.kcl.ac.uk/staff/simonm/provoking#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ns-306161376: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:article-hc2551rz-1 a prov:Entity ;
    dcterms:title "Crime rises in cities"^^xsd:string .

ex:composition-hc2551rz-2 a prov:Entity .
ex:composition-hc2551rz-2 prov:wasGeneratedBy ex:compose-hc2551rz-3 .
ex:composition-hc2551rz-2 prov:qualifiedGeneration _:blank11 .

_:blank11 a prov:Generation ;
    prov:activity ex:compose-hc2551rz-3 .
_:blank11 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#composedData"^^xsd:string .

ex:dataSet1-hc2551rz-4 a prov:Entity .

ex:compose-hc2551rz-3 a prov:Activity .
ex:compose-hc2551rz-3 prov:used ex:dataSet1-hc2551rz-4 , ex:regionList-hc2551rz-5 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:blank12 .
ex:compose-hc2551rz-3 prov:qualifiedUsage _:blank13 .

_:blank12 a prov:Usage ;
    prov:entity ex:dataSet1-hc2551rz-4 .
_:blank12 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#dataToCompose"^^xsd:string .

_:blank13 a prov:Usage ;
    prov:entity ex:regionList-hc2551rz-5 .
_:blank13 prov:hadRole "http://www.inf.kcl.ac.uk/staff/simonm/provoking#regionsToAggregateBy"^^xsd:string .

ex:regionList-hc2551rz-5 a prov:Entity .

ex:chart1-hc2551rz-6 a prov:Entity .
ex:chart1-hc2551rz-6 prov:wasGeneratedBy ex:illustrate-hc2551rz-7 ;
    prov:wasAttributedTo ex:derek-hc2551rz-8 ;
    prov:wasGeneratedBy ex:compile1-hc2551rz-15 .
ex:chart1-hc2551rz-6 prov:qualifiedGeneration _:blank15 .

ex:illustrate-hc2551rz-7 a prov:Activity .
ex:illustrate-hc2551rz-7 prov:used ex:composition-hc2551rz-2 .

ex:derek-hc2551rz-8 a prov:Agent , prov:Person ;
    foaf:mbox <file:/home/moj/Development/workspace/ProvToolbox/prov-rdf/src/test/resources/issues/derek@example.org> ;
    foaf:givenName "Derek"^^xsd:string .
ex:derek-hc2551rz-8 prov:actedOnBehalfOf ex:chartgen-hc2551rz-9 .

ex:chartgen-hc2551rz-9 a prov:Agent , prov:Organization ;
    foaf:name "Chart Generators Inc"^^xsd:string .

ex:dataSet2-hc2551rz-10 a prov:Entity .
ex:dataSet2-hc2551rz-10 prov:qualifiedRevision _:blank8 ;
    prov:wasDerivedFrom ex:dataSet1-hc2551rz-4 ;
    prov:wasGeneratedBy ex:correct-hc2551rz-12 .
_:blank8 a prov:Revision ;
    prov:entity ex:dataSet1-hc2551rz-4 .

ex:chart2-hc2551rz-11 a prov:Entity .
ex:chart2-hc2551rz-11 prov:wasDerivedFrom ex:dataSet2-hc2551rz-10 .
ex:chart2-hc2551rz-11 prov:qualifiedRevision _:blank9 ;
    prov:wasDerivedFrom ex:chart1-hc2551rz-6 ;
    prov:wasGeneratedBy ex:compile2-hc2551rz-16 .
ex:chart2-hc2551rz-11 prov:qualifiedGeneration _:blank16 .
_:blank9 a prov:Revision ;
    prov:entity ex:chart1-hc2551rz-6 .

ex:correct-hc2551rz-12 a prov:Activity ;
    prov:startedAtTime "2012-03-31T09:21:00+01:00"^^xsd:dateTime ;
    prov:endedAtTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .
ex:correct-hc2551rz-12 prov:qualifiedAssociation _:blank14 .

_:blank14 a prov:Association .
_:blank14 prov:hadPlan ex:instructions-hc2551rz-14 .

ex:edith-hc2551rz-13 a prov:Agent , prov:Person .

ex:instructions-hc2551rz-14 a prov:Entity , prov:Plan .

_:blank15 a prov:Generation ;
    prov:activity ex:compile1-hc2551rz-15 .
_:blank15 prov:atTime "2012-03-02T10:30:00Z"^^xsd:dateTime .

ex:compile1-hc2551rz-15 a prov:Activity .

_:blank16 a prov:Generation ;
    prov:activity ex:compile2-hc2551rz-16 .
_:blank16 prov:atTime "2012-04-01T15:21:00+01:00"^^xsd:dateTime .

ex:compile2-hc2551rz-16 a prov:Activity .

ex:blogEntry-hc2551rz-17 a prov:Entity .
ex:blogEntry-hc2551rz-17 prov:qualifiedQuotation _:blank10 ;
    prov:wasDerivedFrom ex:article-hc2551rz-1 .
_:blank10 a prov:Quotation ;
    prov:entity ex:article-hc2551rz-1 .


ex:articleV1-hc2551rz-18 a prov:Entity .
ex:articleV1-hc2551rz-18 prov:specializationOf ex:article-hc2551rz-1 .

ex:articleV2-hc2551rz-19 a prov:Entity .
ex:articleV2-hc2551rz-19 prov:specializationOf ex:article-hc2551rz-1 ;
    prov:alternateOf ex:articleV1-hc2551rz-18 .
@lucmoreau

This comment has been minimized.

Show comment
Hide comment
@lucmoreau

lucmoreau Jul 23, 2015

Owner

The problematic example was:
https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt

Conversion to provn is correct:

curl https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt | provconvert -infile - -informat ttl -outformat provn -outfile -

Conversion to svg also:

curl https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt | provconvert -infile - -informat ttl -outformat svg -outfile - > myfile.svg; inkscape myfile.svg

Owner

lucmoreau commented Jul 23, 2015

The problematic example was:
https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt

Conversion to provn is correct:

curl https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt | provconvert -infile - -informat ttl -outformat provn -outfile -

Conversion to svg also:

curl https://gist.githubusercontent.com/lucmoreau/12d05b3179d46fcb8801/raw/da1fa0b96bfdbf0361bd8da59822552120ef2c52/gistfile1.txt | provconvert -infile - -informat ttl -outformat svg -outfile - > myfile.svg; inkscape myfile.svg

@lucmoreau lucmoreau closed this Jul 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment