summaryrefslogtreecommitdiff
path: root/rdflib/plugins/serializers/trig.py
Commit message (Collapse)AuthorAgeFilesLines
* feat: diverse type hints (#2264)Iwan Aucamp2023-03-121-5/+12
| | | | | | | Add some small diverse type hints. Type hints make RDFLib safer to use and change, as changes and usage can be validated using static analysers like mypy. This change does not have a runtime impact.
* build(deps-dev): bump black from 22.12.0 to 23.1.0 (#2248)dependabot[bot]2023-03-111-1/+0
|
* feat: do not write prefix for empty graph id (#2160)Elie Roux2022-12-301-0/+3
| | | Since the names of empty graphs do not appear in the serialization, do not consider them for namespace issues.
* fix: issue with trig reference counting across graphs (#2085)Iwan Aucamp2022-08-241-9/+5
| | | | | | | | | | | | | | | | | | | | | The TriG serializer was only considering BNode references inside a single graph and not counting the BNodes subjects as references when considering if a BNode should be serialized as unlabeled blank nodes (i.e. `[ ]`), and as a result it was serializing BNodes as unlabeled if they were in fact referencing BNodes in other graphs. One caveat of this change is that some RDF Datasets may be serialized less succinctly in that unlabeled blank nodes would not be used nodes where it is technically possible to use them. This can be trivially fixed, but a trivial fix increases the computational complexity of serialization significantly. Other changes: - Removed the roundtrip xfail that this change fixed. - Added another roundtrip test which has various combinations of BNode references across graphs in a dataset, this test fails for JSON-LD however, so while this change removes one xfail it also now adds another. - Set the default indent_size and style in `.editorconfig` as to avoid relying on undefined system defaults.
* [pre-commit.ci] auto fixes from pre-commit.com hookspre-commit-ci[bot]2022-04-151-1/+0
| | | | for more information, see https://pre-commit.ci
* Add typing to rdflib.termIwan Aucamp2022-01-221-0/+1
| | | | | | | | | | | | | | | This adds as much typing as possible to `rdflib.term`. Other changes: - Added back `warn_unused_ignores`. I actually thought this was enabled but I forgot I disabled it because of some issue on python 3.10. - Disabled `warn_unused_ignores` only for `rdflib.plugin`. There is an ignore in this module which is not needed on python 3.10, this is the most targetted way to avoid having that fail the type checking that I can think of for now. - Removed unused type ignores. This changeset includes no runtime changes.
* blacked parsers & serializersnicholascar2021-12-071-1/+1
|
* Add type hintsIwan Aucamp2021-10-241-3/+16
| | | | | | | This commit only adds type hints and comments and does not make any changes that should affect runtime. The type hints added here derive from work done for #1418.
* 2to3 whole sourcebaset0b32020-06-221-1/+1
| | | | Signed-off-by: t0b3 <thomas.bettler@gmail.com>
* changes for flake8Nicholas Car2020-05-171-2/+2
|
* blacked all python filesNicholas Car2020-05-161-9/+12
|
* removal of all uses of package sixNicholas Car2020-05-161-2/+1
|
* Let argument of serialize method overwrite graph settingsNatanael Arndt2020-04-171-4/+4
|
* inverted precedence of base: graph wins over adding base to serialize(). ↵issue_1003Nicholas Car2020-04-161-2/+6
| | | | Added RDF/XML, TriX & 1/2 TriG (incomplete)
* a slightly opinionated autopep8 runGunnar Aastrand Grimnes2018-10-301-2/+3
| | | | | | | | opinions is mainly: no to long lines, but not at any cost. notation3.py crashses autopep :D Also rdflib/__init__.py gets completely broken
* removed most of the six import from py3compatGunnar Aastrand Grimnes2017-01-301-1/+1
| | | | now six is used throughout.
* converted all base serialisers and parsersGunnar Aastrand Grimnes2017-01-301-2/+2
|
* skip serialising empty default graphGunnar Aastrand Grimnes2017-01-241-0/+2
|
* serialize bnode graph ids in trig correctlyDrew Perttula2015-03-311-3/+6
|
* trig serializer corrections to graph label outputDrew Perttula2015-03-291-1/+4
| | | | | Before: "<short:name> {...}" and "<None> {...}" After: "short:name {...}" and "<http://actual/uri/here> {...}"
* trig serializer wasn't including a @prefix line for the first graph's prefixDrew Perttula2015-03-291-16/+1
|
* made trig serializer work with default contextGunnar Aastrand Grimnes2014-07-111-2/+10
|
* Remove "=" graph naming operator from TriG serializationNiklas Lindström2014-05-081-1/+1
| | | | | This was allowed in earlier TriG drafts, but was since removed and is not allowed by the final W3C Recommendation.
* use qname for trig graph-name - fixes #330Gunnar Aastrand Grimnes2013-12-311-1/+1
|
* Fix broken link to TriG syntax specification.Marat Charlaganov2013-11-131-1/+1
|
* clean up turtle parser a bit, fix repeat subjects in trig parserGunnar Aastrand Grimnes2013-07-301-14/+15
| | | | | | this fixes the bug reporting in #317 also removed redundant trig test.
* Added a TriG parserGunnar Aastrand Grimnes2013-07-291-25/+7
| | | | | | | Also cleaned up N3 parser a bit, and added a Turtle flag, so that special N3 features are not accepted when parsing as turtle. Fixes #273 - now we should add some tests :)
* autopep8Gunnar Aastrand Grimnes2013-04-301-3/+3
|
* fix for trig serializer with triples in wrong graph. Fixes #262.Gunnar Aastrand Grimnes2013-04-261-5/+25
|
* fixed trig bug with repeat triples in various graphsgromgull2013-03-111-0/+1
|
* apply autopep8 standards.Graham Higgins2013-01-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | $ flake8 rdflib --exclude=pyRdfa,host,extras,transform,rdfs,pyMicrodata rdflib/graph.py:192: W801 redefinition of unused 'BytesIO' from line 189 rdflib/graph.py:194: W402 'BytesIO' imported but unused rdflib/graph.py:680:80: E501 line too long (80 > 79 characters) rdflib/graph.py:682:80: E501 line too long (80 > 79 characters) rdflib/graph.py:686:80: E501 line too long (83 > 79 characters) rdflib/graph.py:690:80: E501 line too long (83 > 79 characters) rdflib/graph.py:692:80: E501 line too long (83 > 79 characters) rdflib/graph.py:695:80: E501 line too long (83 > 79 characters) rdflib/graph.py:698:80: E501 line too long (83 > 79 characters) rdflib/parser.py:21: W801 redefinition of unused 'BytesIO' from line 19 rdflib/compat.py:12: W801 redefinition of unused 'defaultdict' from line 10 rdflib/py3compat.py:10: W801 redefinition of unused 'wraps' from line 7 rdflib/py3compat.py:81: W806 redefinition of function 'b' from line 44 rdflib/py3compat.py:87: W806 redefinition of function 'format_doctest_out' from line 50 rdflib/py3compat.py:97: W806 redefinition of function 'type_cmp' from line 61 rdflib/term.py:54: W801 redefinition of unused 'md5' from line 52 rdflib/store.py:73: W801 redefinition of unused 'BytesIO' from line 71 rdflib/query.py:10: W801 redefinition of unused 'BytesIO' from line 8 rdflib/__init__.py:73: W402 'plugin' imported but unused rdflib/__init__.py:74: W402 'query' imported but unused rdflib/util.py:43: W806 redefinition of function 'sign' from line 50 rdflib/plugins/parsers/hturtle.py:25: W801 redefinition of unused 'html5lib' from line 24 rdflib/plugins/parsers/ntriples.py:141: W402 'BytesIO' imported but unused rdflib/plugins/parsers/structureddata.py:23: W801 redefinition of unused 'html5lib' from line 22
* Merge from dzinxed.Gunnar Aastrand Grimnes2012-09-231-0/+1
|\ | | | | | | | | Fixes #232 I picked my changes over yours when we collided for purely selfish reasons, sorry :)
| * Added defaultdict implementation for Python2.4DzinX2012-09-191-1/+4
| | | | | | | | | | I added a separate compatibility.py file to put all functions and classes that provide backward compatibility.
* | added fall-back implementation of defaultdict for py2.4Gunnar Aastrand Grimnes2012-09-231-1/+1
|/
* Pull-by-hand from mammadori's repos commit ↵Graham Higgins2012-06-071-31/+71
| | | | https://github.com/mammadori/rdflib/commit/494429bfad09532b33eee49d197cba997b59f277
* added trig serializergromgull2011-08-191-0/+46