summaryrefslogtreecommitdiff
path: root/rdflib/parser.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix Graph.parse URL handling on windowsIwan Aucamp2021-10-121-4/+7
| | | | | | | | | | Using `pathlib.Path("http://example.com/").exists()` on windows causes an exception as a URL is not a valid path, while `os.path.exists("http://example.com/")` just returns false. This patch reverts _create_input_source_from_location to using `os.path.exists()` instead of pathlib.Path to make it possible to parse graphs from http URLs on windows.
* blacked everything6.0.0Nicholas Car2021-07-201-5/+12
|
* Merge pull request #1288 from tgbugs/path2url-removalNicholas Car2021-07-031-6/+7
|\ | | | | pathname2url removal
| * parser.py fix pathlib mismatchesTom Gillespie2021-03-291-5/+6
| |
| * tweaks to hierarchy to improve load timesTom Gillespie2021-03-261-4/+4
| | | | | | | | | | | | I think that most of the difference actually comes from patching uuid to not waste 25 milliseconds every time it is imported but there is a bit of improvement here
* | Add pathlib.PurePath support for Graph.{serialize,parse}Iwan Aucamp2021-06-291-1/+1
| | | | | | | | | | Graph.parse did already support pathlib.Path but there is no good reason to not support PurePath AFAICT.
* | Merge pull request #1342 from iafork/iwana-issue1040Nicholas Car2021-06-291-1/+17
|\ \ | | | | | | Add handling for 308 (Permanent Redirect)
| * | Use HTTPError.headers instead of HTTPError.hdrsIwan Aucamp2021-06-261-1/+1
| | | | | | | | | | | | | | | Even though HTTPError.hdrs works, it is not in the published API and also not in python typeshed so not recognized by mypy.
| * | Add handling for 308 (Permanent Redirect)Iwan Aucamp2021-06-241-1/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Some/all supported versions of python does not handle 308 (Permanent Redirect) in `urlopen`. See https://bugs.python.org/issue40321 for more info on this. This patch adds handling for 308 in rdflib. I also extracted the HTTP mock from `test_sparqlstore.py` and reused it in test_conneg. Any feedback on it will be appreciated.
* | Add mypy to CI pipelines and fix errors it raisesIwan Aucamp2021-05-301-1/+1
|/
* Support parsing paths specified with pathlibAnton Lodder2020-10-071-0/+3
| | | | | | pathlib was added to the standard librarly as of Python 3.4. This adds support for calling Graph.parse on a file specified using a pathlib object.
* re-run black on parser.py after recent pull-request merges.Ashley Sommer2020-09-181-11/+5
|
* #1160 removed .defrag() and added a testAnatoly Scherbakov2020-09-121-14/+38
|
* #1160 create_input_source() conflicting arguments and a test for themAnatoly Scherbakov2020-09-081-12/+6
|
* Merge remote-tracking branch 'origin/master' into t0b3_masterAshley Sommer2020-08-271-15/+85
|\ | | | | | | | | | | | | | | | | # Conflicts: # rdflib/namespace.py # rdflib/parser.py # rdflib/plugins/memory.py # rdflib/plugins/parsers/ntriples.py # test/test_iomemory.py
| * Merged two Ntriples parser filesAshley Sommer2020-08-191-19/+85
| | | | | | | | | | | | | | Changed name of NTriplesParser to W3CNTriplesParser, it is the legacy parser Populate CharacterStream attr on several types of rdflib InputSource, to provide unicode text stream, in addition to ByteStream Add support to N3, Trig, NTriples, NQuads parsers to use the CharacterStream instead of the ByteStream where possible Reduces many useless string->bytes->string conversions in parsers.
* | 2to3 whole sourcebaset0b32020-06-221-3/+0
|/ | | | Signed-off-by: t0b3 <thomas.bettler@gmail.com>
* blacked all python filesNicholas Car2020-05-161-37/+44
|
* removal of all uses of package sixNicholas Car2020-05-161-10/+10
|
* Also add the old turtle mimetype to match old implementationsNatanael Arndt2018-12-081-1/+1
|
* Add http accept header for turtleNatanael Arndt2018-12-081-0/+2
|
* a slightly opinionated autopep8 runGunnar Aastrand Grimnes2018-10-301-2/+2
| | | | | | | | opinions is mainly: no to long lines, but not at any cost. notation3.py crashses autopep :D Also rdflib/__init__.py gets completely broken
* Accept header should use a q parameterAaron Coburn2017-02-241-1/+1
|
* removed most of the six import from py3compatGunnar Aastrand Grimnes2017-01-301-9/+9
| | | | now six is used throughout.
* six: parser.py: headers, imports, unicode, basestringJoern Hees2017-01-301-11/+16
|
* check for Graph.parse() args: exactly one of source, location, file or dataJoern Hees2015-08-271-2/+10
|
* make sure that Graph.parse closes all files it opened itselfJoern Hees2015-08-271-0/+10
|
* fix handling URLInputSource without content-type, closes #498Joern Hees2015-07-201-1/+2
|
* Expose the urllib2.urlopen response as response_info in URLInputSourceNiklas Lindström2014-11-231-0/+1
| | | | Enables parsers to access response headers (such as Link headers).
* URLInputSource Accept headers for json-ld formatLaurence Rowe2014-09-041-0/+3
| | | Required by rdflib-jsonld to use http://schema.org context which requires fetching with ``Accept: application/ld+json``
* Use special URI for sys.stdin in parser.create_input_source. Fixes #285Niklas Lindström2013-05-191-1/+4
|
* made proper URIs for system-ids of FileInputSource - fixes #279Gunnar Aastrand Grimnes2013-05-081-4/+1
|
* Conform to PEP8Graham Higgins2013-02-071-1/+3
|
* apply autopep8 standards.Graham Higgins2013-01-111-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | $ 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
* misc minor cleanupsGunnar Aastrand Grimnes2012-12-051-5/+1
|
* Hopeful fix for https://github.com/RDFLib/rdflib/issues/130Graham Higgins2012-02-201-7/+10
|
* Hopeful fix for https://github.com/RDFLib/rdflib/issues/145Graham Higgins2012-02-201-0/+3
|
* Make safe for Python 2.7Graham Higgins2012-02-191-2/+3
|
* Uncomment __all__, tests do all passGraham Higgins2012-01-161-1/+1
|
* __all__ together nowGraham Higgins2012-01-141-0/+1
|
* Applied approved fix, closes issue 170Graham Higgins2012-01-131-5/+1
|
* Various fixes for Python 3 compatibility.Thomas Kluyver2011-11-121-6/+2
|
* Various fixes for Python 3 compatibility.Thomas Kluyver2011-11-121-2/+5
|
* Update issue 120eikeon2010-02-131-0/+2
|
* added support to Graph's parse method for case where data is passed as ↵eikeon2010-02-041-0/+2
| | | | unicode; commented out two test cases as Graph's parse method does not support them
* Fixed 103gromgull2010-02-031-6/+16
| | | | ALTHOUGH, there is a more subtle issue here. Now we send the right accept header, but we might still get something else back, in which case we also get the mime-type of whatever it is. Whether we want to be tolerant and try to parse it as what it is, not what we asked for is another question. (Another ticket?)
* Have InputSource subclass object as well (instead of each of its ↵lindstream2009-09-161-8/+8
| | | | subclasses). This made things work for Jython 2.5.
* URLInputSource now gives more informative exception (indicates url that was ↵eikeon2009-04-091-3/+6
| | | | trying to be openned)
* moved namespace bits from term into a namespace moduleeikeon2009-04-021-1/+2
|
* merged in parser related changes from 3.0 branch; fixing pep8 module name ↵eikeon2009-03-081-0/+162
issues for URLInputSource and company along the way