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

Trig parser can creating multiple contexts for the default graph #432

Closed
dschallis opened this issue Oct 31, 2014 · 1 comment
Closed

Trig parser can creating multiple contexts for the default graph #432

dschallis opened this issue Oct 31, 2014 · 1 comment
Assignees
Labels
bug Something isn't working in-resolution parsing Related to a parsing.
Milestone

Comments

@dschallis
Copy link

If TriG containing triples in the default graph are specified with and without braces, they end up in 2 separate contexts, e.g.:

import rdflib

data = """
@prefix : <http://example.com/> .
<> <b> <c> .
{ <d> <e> <f> . }
"""
g = rdflib.ConjunctiveGraph()                                                  
g.parse(data=data, format='trig')                                              
print len(list(g.contexts()))

Prints:

2

whereas it should contain only 1 context, i.e. a single default graph that both those triples should belong to.

I've added a unit test for this to #431 .

@niklasl
Copy link
Member

niklasl commented Aug 4, 2016

I fixed this similarly to the fix in #536 (for #535). The remaining issue is #436, concerning the default_context attribute in relation to how parse(...) dermines target graph using the source and publicID parameters.

@joernhees joernhees added bug Something isn't working in-resolution parsing Related to a parsing. labels Aug 4, 2016
@joernhees joernhees added this to the rdflib 4.2.2 milestone Aug 4, 2016
joernhees added a commit that referenced this issue Oct 15, 2016
* master: (38 commits)
  hardening + warning for serializing invalid numericals (e.g., '"xy.z"^^xsd:float')
  make sure inf/Infinity and nan from numerical types are serialized as INF/NaN
  except inf/nan from plain serialization
  more tests for float and decimal inf/nan serialization (ensures datatypes)
  Only doubles can be infinity or NaN
  Serialisation of nan is "NaN"
  Remove test on serialisation (order is not fixed)
  Add tests requested by @joernhees
  change xxx to issue number (655)
  Test serialisation of infinite values
  Serialisation of infinity is "INF"
  Update requirements files for html5lib version
  Support newer transport_encoding parameter in html5lib parser call
  Set identifier of the parser sink to target graph. Fixes #432.
  Fix TurtleSerializer.isValidList failure on falsy values
  only run flake8 in latest py2 and py3 version
  pinning html5lib to 1.0b8 for now
  removed now unnecessary version restriction from SPARQLWrapper
  updated fuseki used in travis tests to 2.4.0
  travis updates setuptools and pip before installing
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in-resolution parsing Related to a parsing.
Projects
None yet
Development

No branches or pull requests

3 participants