Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference between online translator and this library #58

Closed
satra opened this issue Oct 11, 2014 · 8 comments
Closed

difference between online translator and this library #58

satra opened this issue Oct 11, 2014 · 8 comments

Comments

@satra
Copy link
Contributor

satra commented Oct 11, 2014

using the following example as input to this library and the online translator there is a difference in how qnames are handled. is there a definitive answer? (i would prefer what the online translator did)

https://github.com/trungdong/prov/blob/master/prov/tests/json/activity6.json

the main difference is how the element with type xsd:QName is handled.

Prov library

document
  prefix ex <http://example.org/>

  activity(ex:a6, -, -, [prov:location=1, prov:location="ex:london" %% xsd:QName, 
 prov:location="London", prov:location="1.0" %% xsd:float, 
 prov:location=2014-06-23T12:28:53.858000+01:00,
 prov:location="2002" %% xsd:gYear, prov:label="activity6"])
endDocument

Online translator

document
prefix xsd <http://www.w3.org/2001/XMLSchema>
prefix ex <http://example.org/>
activity(ex:a6,-,-,[prov:label = "activity6", prov:location = "London" %% xsd:string, prov:location = "1" %%
 xsd:int, prov:location = "1.0" %% xsd:float, prov:location = "true" %% xsd:boolean, prov:location =
 'ex:london', prov:location = "2014-06-23T12:28:53.858+01:00" %% xsd:dateTime, prov:location =
 "http://example.org/london" %% xsd:anyURI, prov:location = "2002" %% xsd:gYear])
endDocument
@satra
Copy link
Contributor Author

satra commented Oct 11, 2014

also xsd:dateTime is handled differently.

@satra
Copy link
Contributor Author

satra commented Oct 11, 2014

one more: the prov library doesn't distinguish between these two:

        {
          "$": "ex:london",
          "type": "xsd:QName"
        },
        {
          "$": "http://example.org/london",
          "type": "xsd:anyURI"
        },

it merges them into one.

@satra
Copy link
Contributor Author

satra commented Oct 13, 2014

@trungdong - i hope you don't mind me bombarding with questions. i'm trudging through the tests and they sometimes raise questions:

for example:

Testing: 69, /software/nipy-repo/w3c/prov/prov/tests/json/attr_association_one_role_attr44.json
document
  prefix rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  prefix ex <http://example.org/>

  wasAssociatedWith(ex:ass_r44; ex:a1, ex:ag1, None, [prov:role="<ap:aaa xmlns:ap="http://app/"><ap:bbb><ap:ccc/></ap:bbb></ap:aaa>" %% rdf:XMLLiteral])
endDocument`

how does prov deal with the fact that plan is None or plan is undefined?

@satra
Copy link
Contributor Author

satra commented Oct 13, 2014

the problem with the example in attr_association_one_role_attr44.json is that formal_attributes is not a subset of attributes for this example.

@trungdong
Copy link
Owner

Hi @satra,

I have no problem at all. On the contrary, thank you very much for bringing these issues to our attention.

As you discovered, the PROV-N output has bugs. The main reason is that we don't have round-trip tests for them. These are annoying and is not helpful when you use them for debugging, but not critical.

The issue when QName and URI are merged is more important. I think this is caused by their hash function, which hashes only on the URI string. I'll look into this in a bit.

Sorry for my delay in responding. I'm saturated at the moment.

@trungdong
Copy link
Owner

Just fixed the merging of URI and QName in d8be84a.

@trungdong
Copy link
Owner

I could not reproduce the issue with prov:plan = None in an association.

The output on my machine is:
wasAssociatedWith(ex:ass_r44; ex:a1, ex:ag1, -, [prov:role="<ap:aaa xmlns:ap="http://app/"><ap:bbb><ap:ccc/></ap:bbb></ap:aaa>" %% rdf:XMLLiteral])
which is as expected.

satra added a commit to satra/prov that referenced this issue Oct 14, 2014
* upstream/master:
  Fixed: PROV-N representation for  xsd:dateTime (closed trungdong#58)
  Fixed: Unintended merging of Identifier and QualifiedName values
@satra
Copy link
Contributor Author

satra commented Oct 14, 2014

@trungdong - the None was a bug introduced in the rdf serializer that changed the graph representation. sorry for the noise there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants