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

Not friendly to non-ascii data #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nidm/experiment/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def serializeJSONLD(self):
"startedAtTime": { "@type": "xsd:dateTime", "@id": "prov:startedAtTime" },
"endedAtTime": { "@type": "xsd:dateTime", "@id": "prov:endedAtTime" }
}
return rdf_graph_parse.serialize(format='json-ld', context=context, indent=4).decode('ASCII')
return rdf_graph_parse.serialize(format='json-ld', context=context, indent=4)

def save_DotGraph(self,filename,format=None):
dot = prov_to_dot(self.graph)
Expand Down
2 changes: 1 addition & 1 deletion nidm/experiment/tools/BIDSMRI2NIDM.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def main(argv):
if args.jsonld:
f.write(project.serializeJSONLD())
else:
f.write(project.serializeTurtle())
f.write(project.serializeTurtle().decode('ASCII'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pynidm is py3 only. why would this be necessary. were you testing on python 3 or 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just moving the decode('ASCI') away -- not introducing it. I am not sure why one wants this, but it certainly is detrimental for JSON-LD. If you are confident that it being there at all (and not just in the way of JSON-LD) is the real bug, I have no objections to wipe it out entirely. And no, this is all PY3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - will take a look

#f.write(project.graph.get_provn())
#save a DOT graph as PNG
project.save_DotGraph(str(outputfile + ".png"), format="png")
Expand Down