lucmoreau / ProvToolbox

Java toolkit to create and convert W3C PROV data model representations, and build provenance-enabled applications in a variety of programming languages (java, python, typescript, javascript)
Other
75 stars 42 forks source link

prov:hadRole not converted properly #82

Closed lucmoreau closed 10 years ago

lucmoreau commented 11 years ago

The following converts the role ex:LoggedInUser to "http://x/LoggedInUser" %% xsd:string

This shows up in both provn and json. I suspect the problem occurs when parsing rdf.

@prefix prov: http://www.w3.org/ns/prov#. @prefix ex: http://x/.

ex:db7d3cae308d11e3981214109fcf6ae7 a prov:Activity ; prov:qualifiedAssociation [ a prov:Association ; prov:hadRole ex:LoggedInUser ; prov:agent ex:db8093e8308d11e3986f14109fcf6ae7 ].

document prefix bnode http://openprovenance.org/provtoolbox/bnode/ prefix xsd http://www.w3.org/2001/XMLSchema# prefix ex http://x/ prefix prov http://www.w3.org/ns/prov# prefix ns-306161376 http://www.w3.org/1999/02/22-rdf-syntax-ns# activity(ex:db7d3cae308d11e3981214109fcf6ae7,-,-) wasAssociatedWith(ex:db7d3cae308d11e3981214109fcf6ae7,ex:db8093e8308d11e3986f14109fcf6ae7,-,[prov:role = "http://x/LoggedInUser" %% xsd:string]) endDocument

satra commented 11 years ago

@lucmoreau - trimmed the example down to the necessary triples. also changed prov:Role to have a uri for the resource. if this doesn't look write, please let me know.

@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix nipype: <http://nipy.org/nipype/terms/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xsd1: <http://www.w3.org/2001/XMLSchema-datatypes#> .

<http://nipy.org/nipype/terms/1ae7717d39d811e38b2f14109fcf6ae7> a prov:Activity ;
    prov:qualifiedAssociation [ a prov:Association ;
            prov:Role nipype:Software ;
            prov:agent <http://nipy.org/nipype/terms/1afc865139d811e3bb9814109fcf6ae7> ],
        [ a prov:Association ;
            prov:Role nipype:LoggedInUser ;
            prov:agent <http://nipy.org/nipype/terms/1afb19f039d811e3b1e514109fcf6ae7> ] ;
    prov:wasAssociatedWith <http://nipy.org/nipype/terms/1afb19f039d811e3b1e514109fcf6ae7>,
        <http://nipy.org/nipype/terms/1afc865139d811e3bb9814109fcf6ae7> .

<http://nipy.org/nipype/terms/1afb19f039d811e3b1e514109fcf6ae7> a prov:Agent,
        prov:Person ;
    prov:label "satra" ;
    foaf:name "satra" .

<http://nipy.org/nipype/terms/1afc865139d811e3bb9814109fcf6ae7> a prov:Agent,
        prov:SoftwareAgent ;
    prov:label "Nipype" ;
    foaf:name "Nipype" .
lucmoreau commented 10 years ago

Following example now translates properly.

@prefix prov: http://www.w3.org/ns/prov#. @prefix ex: http://x/.

ex:db7d3cae308d11e3981214109fcf6ae7 a prov:Activity ; prov:qualifiedAssociation [ a prov:Association ; prov:hadRole ex:LoggedInUser ; prov:agent ex:db8093e8308d11e3986f14109fcf6ae7 ].

Note: make sure you use prov:hadRole and not prov:Role.

satra commented 10 years ago

thanks @lucmoreau