diff --git a/testbed/RDFLib__rdflib/.coveragerc b/testbed/RDFLib__rdflib/.coveragerc
new file mode 100644
index 0000000000000000000000000000000000000000..c68b13265dece848b5ba0faa8770d95811c7aede
--- /dev/null
+++ b/testbed/RDFLib__rdflib/.coveragerc
@@ -0,0 +1,36 @@
+# .coveragerc to control coverage.py
+[run]
+branch = True
+#source = rdflib,build/src/rdflib # specified in .travis.yml for different envs
+omit = */site-packages/*
+
+[report]
+# Regexes for lines to exclude from consideration
+exclude_lines =
+ # Have to re-enable the standard pragma
+ pragma: no cover
+
+ # Don't complain about missing debug-only code:
+ #def __repr__
+ #if self\.debug
+
+ # Don't complain if tests don't hit defensive assertion code:
+ #raise AssertionError
+ #raise NotImplementedError
+
+ # Don't complain if non-runnable code isn't run:
+ if 0:
+ if __name__ == .__main__.:
+ if __name__==.__main__.:
+
+# path mappings for the py3 environments (doesn't seem to work on coveralls yet)
+[paths]
+source =
+ rdflib/
+ build/src/rdflib/
+tests =
+ test/
+ build/src/test/
+examples =
+ examples/
+ build/src/examples/
diff --git a/testbed/RDFLib__rdflib/.gitignore b/testbed/RDFLib__rdflib/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..17184737e7708c9c79d07324fa3722c48b09c98e
--- /dev/null
+++ b/testbed/RDFLib__rdflib/.gitignore
@@ -0,0 +1,19 @@
+RDFLib.sublime-project
+/docs/_build/
+nosetests.xml
+RDFLib.sublime-workspace
+*.egg-info/
+coverage/
+dist/
+__pycache__/
+*.pyc
+/.hgtags
+/.hgignore
+build/
+/.coverage
+/.tox/
+/docs/draft/
+*~
+test_reports/*latest.ttl
+# PyCharm
+.idea/
\ No newline at end of file
diff --git a/testbed/RDFLib__rdflib/.pep8 b/testbed/RDFLib__rdflib/.pep8
new file mode 100644
index 0000000000000000000000000000000000000000..acc7b2d3445619ed21c00f62d9f869d29657b9ff
--- /dev/null
+++ b/testbed/RDFLib__rdflib/.pep8
@@ -0,0 +1,4 @@
+[pep8]
+ignore = W806
+max-line-length = 85
+exclude = host,extras,transform,rdfs
diff --git a/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh b/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh
new file mode 100644
index 0000000000000000000000000000000000000000..49e91f2c10663944f4286e1914d5cf55896c8a49
--- /dev/null
+++ b/testbed/RDFLib__rdflib/.travis.fuseki_install_optional.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -v
+
+uri="http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-2.4.0.tar.gz"
+
+if wget "$uri" &&
+ tar -zxf *jena*fuseki*.tar.gz &&
+ mv *jena*fuseki*/ fuseki &&
+ cd fuseki ; then
+ # normal SPARQLStore & Dataset tests:
+ bash fuseki-server --port 3030 --debug --update --mem /db &>fuseki.log &
+ # SPARQLUpdateStore tests & ConjunctiveGraph endpoint behavior:
+ bash fuseki-server --port 3031 --debug --update --memTDB --set tdb:unionDefaultGraph=true /db &>fuseki.log &
+ sleep 2
+ cd ..
+else
+ echo "fuseki install failed, skipping... please check URI" >&2
+fi
diff --git a/testbed/RDFLib__rdflib/.travis.yml b/testbed/RDFLib__rdflib/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f37f0750d5c5ec2ce18835ba4155bb179e18ad28
--- /dev/null
+++ b/testbed/RDFLib__rdflib/.travis.yml
@@ -0,0 +1,44 @@
+# http://travis-ci.org/#!/RDFLib/rdflib
+sudo: false
+language: python
+branches:
+ only:
+ # only build master and release branches (merge request are built anyhow)
+ - master
+ - /^\d+\.\d+\.\d+(-.*)?$/
+git:
+ depth: 3
+
+python:
+ - 2.7
+ - 3.4
+ - 3.5
+ - 3.6
+
+matrix:
+ include:
+ - python: 3.7
+ dist: xenial
+ sudo: true
+
+before_install:
+ - pip install -U setuptools pip # seems travis comes with a too old setuptools for html5lib
+ - bash .travis.fuseki_install_optional.sh
+
+install:
+ - pip install --default-timeout 60 -r requirements.txt
+ - pip install --default-timeout 60 coverage coveralls nose-timer && export HAS_COVERALLS=1
+ - python setup.py install
+
+before_script:
+ - flake8 --exclude=pyRdfa,extras,host,transform,rdfs,sparql,results,pyMicrodata --exit-zero rdflib
+
+script:
+ - PYTHONWARNINGS=default nosetests --with-timer --timer-top-n 42 --with-coverage --cover-tests --cover-package=rdflib
+
+after_success:
+ - if [[ $HAS_COVERALLS ]] ; then coveralls ; fi
+
+notifications:
+ irc:
+ channels: "chat.freenode.net#rdflib"
diff --git a/testbed/RDFLib__rdflib/CHANGELOG.md b/testbed/RDFLib__rdflib/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..06cdada724b83dc2221dfcc6a39931e1f70602dc
--- /dev/null
+++ b/testbed/RDFLib__rdflib/CHANGELOG.md
@@ -0,0 +1,1724 @@
+2017/01/29 RELEASE 4.2.2
+========================
+
+This is a bug-fix release, and the last release in the 4.X.X series.
+
+Bug fixes:
+----------
+* SPARQL bugs fixed:
+ * Fix for filters in sub-queries
+ [#693](https://github.com/RDFLib/rdflib/pull/693)
+ * Fixed bind, initBindings and filter problems
+ [#294](https://github.com/RDFLib/rdflib/issues/294)
+ [#555](https://github.com/RDFLib/rdflib/pull/555)
+ [#580](https://github.com/RDFLib/rdflib/issues/580)
+ [#586](https://github.com/RDFLib/rdflib/issues/586)
+ [#601](https://github.com/RDFLib/rdflib/pull/601)
+ [#615](https://github.com/RDFLib/rdflib/issues/615)
+ [#617](https://github.com/RDFLib/rdflib/issues/617)
+ [#619](https://github.com/RDFLib/rdflib/issues/619)
+ [#630](https://github.com/RDFLib/rdflib/issues/630)
+ [#653](https://github.com/RDFLib/rdflib/issues/653)
+ [#686](https://github.com/RDFLib/rdflib/issues/686)
+ [#688](https://github.com/RDFLib/rdflib/pull/688)
+ [#692](https://github.com/RDFLib/rdflib/pull/692)
+ * Fixed unexpected None value in SPARQL-update
+ [#633](https://github.com/RDFLib/rdflib/issues/633)
+ [#634](https://github.com/RDFLib/rdflib/pull/634)
+ * Fix sparql, group by and count of null values with `optional`
+ [#631](https://github.com/RDFLib/rdflib/issues/631)
+ * Fixed sparql sub-query and aggregation bugs
+ [#607](https://github.com/RDFLib/rdflib/issues/607)
+ [#610](https://github.com/RDFLib/rdflib/pull/610)
+ [#628](https://github.com/RDFLib/rdflib/issues/628)
+ [#694](https://github.com/RDFLib/rdflib/pull/694)
+ * Fixed parsing Complex BGPs as triples
+ [#622](https://github.com/RDFLib/rdflib/pull/622)
+ [#623](https://github.com/RDFLib/rdflib/issues/623)
+ * Fixed DISTINCT being ignored inside aggregate functions
+ [#404](https://github.com/RDFLib/rdflib/issues/404)
+ [#611](https://github.com/RDFLib/rdflib/pull/611)
+ [#678](https://github.com/RDFLib/rdflib/pull/678)
+ * Fix unicode encoding errors in sparql processor
+ [#446](https://github.com/RDFLib/rdflib/issues/446)
+ [#599](https://github.com/RDFLib/rdflib/pull/599)
+ * Fixed SPARQL select nothing no longer returning a `None` row
+ [#554](https://github.com/RDFLib/rdflib/issues/554)
+ [#592](https://github.com/RDFLib/rdflib/pull/592)
+ * Fixed aggregate operators COUNT and SAMPLE to ignore unbound / NULL values
+ [#564](https://github.com/RDFLib/rdflib/pull/564)
+ [#563](https://github.com/RDFLib/rdflib/issues/563)
+ [#567](https://github.com/RDFLib/rdflib/pull/567)
+ [#568](https://github.com/RDFLib/rdflib/pull/568)
+ * Fix sparql relative uris
+ [#523](https://github.com/RDFLib/rdflib/issues/523)
+ [#524](https://github.com/RDFLib/rdflib/pull/524)
+ * SPARQL can now compare xsd:date type as well, fixes #532
+ [#532](https://github.com/RDFLib/rdflib/issues/532)
+ [#533](https://github.com/RDFLib/rdflib/pull/533)
+ * fix sparql path order on python3: "TypeError: unorderable types: SequencePath() < SequencePath()""
+ [#492](https://github.com/RDFLib/rdflib/issues/492)
+ [#525](https://github.com/RDFLib/rdflib/pull/525)
+ * SPARQL parser now robust to spurious semicolon
+ [#381](https://github.com/RDFLib/rdflib/issues/381)
+ [#528](https://github.com/RDFLib/rdflib/pull/528)
+ * Let paths be comparable against all nodes even in py3 (preparedQuery error)
+ [#545](https://github.com/RDFLib/rdflib/issues/545)
+ [#552](https://github.com/RDFLib/rdflib/pull/552)
+ * Made behavior of `initN` in `update` and `query` more consistent
+ [#579](https://github.com/RDFLib/rdflib/issues/579)
+ [#600](https://github.com/RDFLib/rdflib/pull/600)
+* SparqlStore:
+ * SparqlStore now closes underlying urllib response body
+ [#638](https://github.com/RDFLib/rdflib/pull/638)
+ [#683](https://github.com/RDFLib/rdflib/pull/683)
+ * SparqlStore injectPrefixes only modifies query if prefixes present and if adds a newline in between
+ [#521](https://github.com/RDFLib/rdflib/issues/521)
+ [#522](https://github.com/RDFLib/rdflib/pull/522)
+* Fixes and tests for AuditableStore
+ [#537](https://github.com/RDFLib/rdflib/pull/537)
+ [#557](https://github.com/RDFLib/rdflib/pull/557)
+* Trig bugs fixed:
+ * trig export of multiple graphs assigns wrong prefixes to prefixedNames
+ [#679](https://github.com/RDFLib/rdflib/issues/679)
+ * Trig serialiser writing empty named graph name for default graph
+ [#433](https://github.com/RDFLib/rdflib/issues/433)
+ * Trig parser can creating multiple contexts for the default graph
+ [#432](https://github.com/RDFLib/rdflib/issues/432)
+ * Trig serialisation handling prefixes incorrectly
+ [#428](https://github.com/RDFLib/rdflib/issues/428)
+ [#699](https://github.com/RDFLib/rdflib/pull/699)
+* Fixed Nquads parser handling of triples in default graph
+ [#535](https://github.com/RDFLib/rdflib/issues/535)
+ [#536](https://github.com/RDFLib/rdflib/pull/536)
+* Fixed TypeError in Turtle serializer (unorderable types: DocumentFragment() > DocumentFragment())
+ [#613](https://github.com/RDFLib/rdflib/issues/613)
+ [#648](https://github.com/RDFLib/rdflib/issues/648)
+ [#666](https://github.com/RDFLib/rdflib/pull/666)
+ [#676](https://github.com/RDFLib/rdflib/issues/676)
+* Fixed serialization and parsing of inf/nan
+ [#655](https://github.com/RDFLib/rdflib/pull/655)
+ [#658](https://github.com/RDFLib/rdflib/pull/658)
+* Fixed RDFa parser from failing on time elements with child nodes
+ [#576](https://github.com/RDFLib/rdflib/issues/576)
+ [#577](https://github.com/RDFLib/rdflib/pull/577)
+* Fix double reduction of \\ escapes in from_n3
+ [#546](https://github.com/RDFLib/rdflib/issues/546)
+ [#548](https://github.com/RDFLib/rdflib/pull/548)
+* Fixed handling of xsd:base64Binary
+ [#646](https://github.com/RDFLib/rdflib/issues/646)
+ [#674](https://github.com/RDFLib/rdflib/pull/674)
+* Fixed Collection.__setitem__ broken
+ [#604](https://github.com/RDFLib/rdflib/issues/604)
+ [#605](https://github.com/RDFLib/rdflib/pull/605)
+* Fix ImportError when __main__ already loaded
+ [#616](https://github.com/RDFLib/rdflib/pull/616)
+* Fixed broken top_level.txt file in distribution
+ [#571](https://github.com/RDFLib/rdflib/issues/571)
+ [#572](https://github.com/RDFLib/rdflib/pull/572)
+ [#573](https://github.com/RDFLib/rdflib/pull/573)
+
+
+Enhancements:
+-------------
+* Added support for Python 3.5+
+ [#526](https://github.com/RDFLib/rdflib/pull/526)
+* More aliases for common formats (nt, turtle)
+ [#701](https://github.com/RDFLib/rdflib/pull/701)
+* Improved RDF1.1 ntriples support
+ [#695](https://github.com/RDFLib/rdflib/issues/695)
+ [#700](https://github.com/RDFLib/rdflib/pull/700)
+* Dependencies updated and improved compatibility with pyparsing, html5lib, SPARQLWrapper and elementtree
+ [#550](https://github.com/RDFLib/rdflib/pull/550)
+ [#589](https://github.com/RDFLib/rdflib/issues/589)
+ [#606](https://github.com/RDFLib/rdflib/issues/606)
+ [#641](https://github.com/RDFLib/rdflib/pull/641)
+ [#642](https://github.com/RDFLib/rdflib/issues/642)
+ [#650](https://github.com/RDFLib/rdflib/pull/650)
+ [#671](https://github.com/RDFLib/rdflib/issues/671)
+ [#675](https://github.com/RDFLib/rdflib/pull/675)
+ [#684](https://github.com/RDFLib/rdflib/pull/684)
+ [#696](https://github.com/RDFLib/rdflib/pull/696)
+* Improved prefix for SPARQL namespace in XML serialization
+ [#493](https://github.com/RDFLib/rdflib/issues/493)
+ [#588](https://github.com/RDFLib/rdflib/pull/588)
+* Performance improvements:
+ * SPARQL Aggregation functions don't build up memory for each row
+ [#678](https://github.com/RDFLib/rdflib/pull/678)
+ * Collections now support += (__iadd__), fixes slow creation of large lists
+ [#609](https://github.com/RDFLib/rdflib/issues/609)
+ [#612](https://github.com/RDFLib/rdflib/pull/612)
+ [#691](https://github.com/RDFLib/rdflib/pull/691)
+ * SPARQL Optimisation to expand BGPs in a smarter way
+ [#547](https://github.com/RDFLib/rdflib/pull/547)
+* SPARQLStore improvements
+ * improved SPARQLStore BNode customizability
+ [#511](https://github.com/RDFLib/rdflib/issues/511)
+ [#512](https://github.com/RDFLib/rdflib/pull/512)
+ [#513](https://github.com/RDFLib/rdflib/pull/513)
+ [#603](https://github.com/RDFLib/rdflib/pull/603)
+ * Adding the option of using POST for long queries in SPARQLStore
+ [#672](https://github.com/RDFLib/rdflib/issues/672)
+ [#673](https://github.com/RDFLib/rdflib/pull/673)
+ * Exposed the timeout of SPARQLWrapper
+ [#531](https://github.com/RDFLib/rdflib/pull/531)
+* SPARQL prepared query now carries the original (unparsed) parameters
+ [#565](https://github.com/RDFLib/rdflib/pull/565)
+* added .n3 methods for path objects
+ [#553](https://github.com/RDFLib/rdflib/pull/553)
+* Added support for xsd:gYear and xsd:gYearMonth
+ [#635](https://github.com/RDFLib/rdflib/issues/635)
+ [#636](https://github.com/RDFLib/rdflib/pull/636)
+* Allow duplicates in rdf:List
+ [#223](https://github.com/RDFLib/rdflib/issues/223)
+ [#690](https://github.com/RDFLib/rdflib/pull/690)
+* Improved slicing of Resource objects
+ [#529](https://github.com/RDFLib/rdflib/pull/529)
+
+
+Cleanups:
+---------
+* cleanup: SPARQL Prologue and Query new style classes
+ [#566](https://github.com/RDFLib/rdflib/pull/566)
+* Reduce amount of warnings, especially closing opened file pointers
+ [#518](https://github.com/RDFLib/rdflib/pull/518)
+ [#651](https://github.com/RDFLib/rdflib/issues/651)
+* Improved ntriples parsing exceptions to actually tell you what's wrong
+ [#640](https://github.com/RDFLib/rdflib/pull/640)
+ [#643](https://github.com/RDFLib/rdflib/pull/643)
+* remove ancient and broken 2.3 support code.
+ [#680](https://github.com/RDFLib/rdflib/issues/680)
+ [#681](https://github.com/RDFLib/rdflib/pull/681)
+* Logger output improved
+ [#662](https://github.com/RDFLib/rdflib/pull/662)
+* properly cite RGDA1
+ [#624](https://github.com/RDFLib/rdflib/pull/624)
+* Avoid class reference to imported function
+ [#574](https://github.com/RDFLib/rdflib/issues/574)
+ [#578](https://github.com/RDFLib/rdflib/pull/578)
+* Use find_packages for package discovery.
+ [#590](https://github.com/RDFLib/rdflib/pull/590)
+* Prepared ClosedNamespace (and _RDFNamespace) to inherit from Namespace (5.0.0)
+ [#551](https://github.com/RDFLib/rdflib/pull/551)
+ [#595](https://github.com/RDFLib/rdflib/pull/595)
+* Avoid verbose build logging
+ [#534](https://github.com/RDFLib/rdflib/pull/534)
+* (ultra petty) Remove an unused import
+ [#593](https://github.com/RDFLib/rdflib/pull/593)
+
+
+Testing improvements:
+---------------------
+* updating deprecated testing syntax
+ [#697](https://github.com/RDFLib/rdflib/pull/697)
+* make test 375 more portable (use sys.executable rather than python)
+ [#664](https://github.com/RDFLib/rdflib/issues/664)
+ [#668](https://github.com/RDFLib/rdflib/pull/668)
+* Removed outdated, skipped test for #130 that depended on content from the internet
+ [#256](https://github.com/RDFLib/rdflib/issues/256)
+* enable all warnings during travis nosetests
+ [#517](https://github.com/RDFLib/rdflib/pull/517)
+* travis updates
+ [#659](https://github.com/RDFLib/rdflib/issues/659)
+* travis also builds release branches
+ [#598](https://github.com/RDFLib/rdflib/pull/598)
+
+
+Doc improvements:
+-----------------
+* Update list of builtin serialisers in docstring
+ [#621](https://github.com/RDFLib/rdflib/pull/621)
+* Update reference to "Emulating container types"
+ [#575](https://github.com/RDFLib/rdflib/issues/575)
+ [#581](https://github.com/RDFLib/rdflib/pull/581)
+ [#583](https://github.com/RDFLib/rdflib/pull/583)
+ [#584](https://github.com/RDFLib/rdflib/pull/584)
+* docs: clarify the use of an identifier when persisting a triplestore
+ [#654](https://github.com/RDFLib/rdflib/pull/654)
+* DOC: unamed -> unnamed, typos
+ [#562](https://github.com/RDFLib/rdflib/pull/562)
+
+
+
+2015/08/12 RELEASE 4.2.1
+========================
+
+This is a bug-fix release.
+
+Minor enhancements:
+-------------------
+* Added a Networkx connector
+ [#471](https://github.com/RDFLib/rdflib/pull/471),
+ [#507](https://github.com/RDFLib/rdflib/pull/507)
+* Added a graph_tool connector
+ [#473](https://github.com/RDFLib/rdflib/pull/473)
+* Added a `graphs` method to the Dataset object
+ [#504](https://github.com/RDFLib/rdflib/pull/504),
+ [#495](https://github.com/RDFLib/rdflib/issues/495)
+* Batch commits for `SPARQLUpdateStore`
+ [#486](https://github.com/RDFLib/rdflib/pull/486)
+
+Bug fixes:
+----------
+* Fixed bnode collision bug
+ [#506](https://github.com/RDFLib/rdflib/pull/506),
+ [#496](https://github.com/RDFLib/rdflib/pull/496),
+ [#494](https://github.com/RDFLib/rdflib/issues/494)
+* fix `util.from_n3()` parsing Literals with datatypes and Namespace support
+ [#503](https://github.com/RDFLib/rdflib/pull/503),
+ [#502](https://github.com/RDFLib/rdflib/issues/502)
+* make `Identifier.__hash__` stable wrt. multi processes
+ [#501](https://github.com/RDFLib/rdflib/pull/501),
+ [#500](https://github.com/RDFLib/rdflib/issues/500)
+* fix handling `URLInputSource` without content-type
+ [#499](https://github.com/RDFLib/rdflib/pull/499),
+ [#498](https://github.com/RDFLib/rdflib/pull/498)
+* no relative import in `algebra` when run as a script
+ [#497](https://github.com/RDFLib/rdflib/pull/497)
+* Duplicate option in armstrong `theme.conf` removed
+ [#491](https://github.com/RDFLib/rdflib/issues/491)
+* `Variable.__repr__` returns a python representation string, not n3
+ [#488](https://github.com/RDFLib/rdflib/pull/488)
+* fixed broken example
+ [#482](https://github.com/RDFLib/rdflib/pull/482)
+* trig output fixes
+ [#480](https://github.com/RDFLib/rdflib/pull/480)
+* set PYTHONPATH to make rdfpipe tests use the right rdflib version
+ [#477](https://github.com/RDFLib/rdflib/pull/477)
+* fix RDF/XML problem with unqualified use of `rdf:about`
+ [#470](https://github.com/RDFLib/rdflib/pull/470),
+ [#468](https://github.com/RDFLib/rdflib/issues/468)
+* `AuditableStore` improvements
+ [#469](https://github.com/RDFLib/rdflib/pull/469),
+ [#463](https://github.com/RDFLib/rdflib/pull/463)
+* added asserts for `graph.set([s,p,o])` so `s` and `p` aren't `None`
+ [#467](https://github.com/RDFLib/rdflib/pull/467)
+* `threading.RLock` instances are context managers
+ [#465](https://github.com/RDFLib/rdflib/pull/465)
+* SPARQLStore does not transform Literal('') into Literal('None') anymore
+ [#459](https://github.com/RDFLib/rdflib/pull/459),
+ [#457](https://github.com/RDFLib/rdflib/issues/457)
+* slight performance increase for graph.all_nodes()
+ [#458](https://github.com/RDFLib/rdflib/pull/458)
+
+Testing improvements:
+---------------------
+* travis: migrate to docker container infrastructure
+ [#508](https://github.com/RDFLib/rdflib/pull/508)
+* test for narrow python builds (chars > 0xFFFF) (related to
+ [#453](https://github.com/RDFLib/rdflib/pull/453),
+ [#454](https://github.com/RDFLib/rdflib/pull/454)
+ )
+ [#456](https://github.com/RDFLib/rdflib/issues/456),
+ [#509](https://github.com/RDFLib/rdflib/pull/509)
+* dropped testing py3.2
+ [#448](https://github.com/RDFLib/rdflib/issues/448)
+* Running a local fuseki server on travis and making it failsafe
+ [#476](https://github.com/RDFLib/rdflib/pull/476),
+ [#475](https://github.com/RDFLib/rdflib/issues/475),
+ [#474](https://github.com/RDFLib/rdflib/pull/474),
+ [#466](https://github.com/RDFLib/rdflib/pull/466),
+ [#460](https://github.com/RDFLib/rdflib/issues/460)
+* exclude `def main():` functions from test coverage analysis
+ [#472](https://github.com/RDFLib/rdflib/pull/472)
+
+
+2015/02/19 RELEASE 4.2.0
+========================
+
+This is a new minor version of RDFLib including a handful of new features:
+
+* Supporting N-Triples 1.1 syntax using UTF-8 encoding
+ [#447](https://github.com/RDFLib/rdflib/pull/447),
+ [#449](https://github.com/RDFLib/rdflib/pull/449),
+ [#400](https://github.com/RDFLib/rdflib/issues/400)
+* Graph comparison now really works using RGDA1 (RDF Graph Digest Algorithm 1)
+ [#441](https://github.com/RDFLib/rdflib/pull/441)
+ [#385](https://github.com/RDFLib/rdflib/issues/385)
+* More graceful degradation than simple crashing for unicode chars > 0xFFFF on
+ narrow python builds. Parsing such characters will now work, but issue a
+ UnicodeWarning. If you run `python -W all` you will already see a warning on
+ `import rdflib` will show a warning (ImportWarning).
+ [#453](https://github.com/RDFLib/rdflib/pull/453),
+ [#454](https://github.com/RDFLib/rdflib/pull/454)
+* URLInputSource now supports json-ld
+ [#425](https://github.com/RDFLib/rdflib/pull/425)
+* SPARQLStore is now graph aware
+ [#401](https://github.com/RDFLib/rdflib/pull/401),
+ [#402](https://github.com/RDFLib/rdflib/pull/402)
+* SPARQLStore now uses SPARQLWrapper for updates
+ [#397](https://github.com/RDFLib/rdflib/pull/397)
+* Certain logging output is immediately shown in interactive mode
+ [#414](https://github.com/RDFLib/rdflib/pull/414)
+* Python 3.4 fully supported
+ [#418](https://github.com/RDFLib/rdflib/pull/418)
+
+Minor enhancements & bugs fixed:
+--------------------------------
+
+* Fixed double invocation of 2to3
+ [#437](https://github.com/RDFLib/rdflib/pull/437)
+* PyRDFa parser missing brackets
+ [#434](https://github.com/RDFLib/rdflib/pull/434)
+* Correctly handle \uXXXX and \UXXXXXXXX escapes in n3 files
+ [#426](https://github.com/RDFLib/rdflib/pull/426)
+* Logging cleanups and keeping it on stderr
+ [#420](https://github.com/RDFLib/rdflib/pull/420)
+ [#414](https://github.com/RDFLib/rdflib/pull/414)
+ [#413](https://github.com/RDFLib/rdflib/issues/413)
+* n3: allow @base URI to have a trailing '#'
+ [#407](https://github.com/RDFLib/rdflib/pull/407)
+ [#379](https://github.com/RDFLib/rdflib/issues/379)
+* microdata: add file:// to base if it's a filename so rdflib can parse its own
+ output
+ [#406](https://github.com/RDFLib/rdflib/pull/406)
+ [#403](https://github.com/RDFLib/rdflib/issues/403)
+* TSV Results parse skips empty bindings in result
+ [#390](https://github.com/RDFLib/rdflib/pull/390)
+* fixed accidental test run due to name
+ [#389](https://github.com/RDFLib/rdflib/pull/389)
+* Bad boolean list serialization to Turtle & fixed ambiguity between
+ Literal(False) and None
+ [#387](https://github.com/RDFLib/rdflib/pull/387)
+ [#382](https://github.com/RDFLib/rdflib/pull/382)
+* Current version number & PyPI link in README.md
+ [#383](https://github.com/RDFLib/rdflib/pull/383)
+
+
+2014/04/15 RELEASE 4.1.2
+========================
+
+This is a bug-fix release.
+
+* Fixed unicode/str bug in py3 for rdfpipe
+ [#375](https://github.com/RDFLib/rdflib/issues/375)
+
+2014/03/03 RELEASE 4.1.1
+========================
+
+This is a bug-fix release.
+
+This will be the last RDFLib release to support python 2.5.
+
+* The RDF/XML Parser was made stricter, now raises exceptions for
+ illegal repeated node-elements.
+ [#363](https://github.com/RDFLib/rdflib/issues/363)
+
+* The SPARQLUpdateStore now supports non-ascii unicode in update
+ statements
+ [#356](https://github.com/RDFLib/rdflib/issues/356)
+
+* Fixed a bug in the NTriple/NQuad parser wrt. to unicode escape sequences
+ [#352](https://github.com/RDFLib/rdflib/issues/352)
+
+* HTML5Lib is no longer pinned to 0.95
+ [#355](https://github.com/RDFLib/rdflib/issues/360)
+
+* RDF/XML Serializer now uses parseType=Literal for well-formed XML literals
+
+* A bug in the manchester OWL syntax was fixed
+ [#355](https://github.com/RDFLib/rdflib/issues/355)
+
+2013/12/31 RELEASE 4.1
+======================
+
+This is a new minor version RDFLib, which includes a handful of new features:
+
+* A TriG parser was added (we already had a serializer) - it is
+ up-to-date wrt. to the newest spec from: http://www.w3.org/TR/trig/
+
+* The Turtle parser was made up to date wrt. to the latest Turtle spec.
+
+* Many more tests have been added - RDFLib now has over 2000
+ (passing!) tests. This is mainly thanks to the NT, Turtle, TriG,
+ NQuads and SPARQL test-suites from W3C. This also included many
+ fixes to the nt and nquad parsers.
+
+* ```ConjunctiveGraph``` and ```Dataset``` now support directly adding/removing
+ quads with ```add/addN/remove``` methods.
+
+* ```rdfpipe``` command now supports datasets, and reading/writing context
+ sensitive formats.
+
+* Optional graph-tracking was added to the Store interface, allowing
+ empty graphs to be tracked for Datasets. The DataSet class also saw
+ a general clean-up, see: [#309](https://github.com/RDFLib/rdflib/pull/309)
+
+* After long deprecation, ```BackwardCompatibleGraph``` was removed.
+
+Minor enhancements/bugs fixed:
+------------------------------
+
+* Many code samples in the documentation were fixed thanks to @PuckCh
+
+* The new ```IOMemory``` store was optimised a bit
+
+* ```SPARQL(Update)Store``` has been made more generic.
+
+* MD5 sums were never reinitialized in ```rdflib.compare```
+
+* Correct default value for empty prefix in N3
+ [#312](https://github.com/RDFLib/rdflib/issues/312)
+
+* Fixed tests when running in a non UTF-8 locale
+ [#344](https://github.com/RDFLib/rdflib/issues/344)
+
+* Prefix in the original turtle have an impact on SPARQL query
+ resolution
+ [#313](https://github.com/RDFLib/rdflib/issues/313)
+
+* Duplicate BNode IDs from N3 Parser
+ [#305](https://github.com/RDFLib/rdflib/issues/305)
+
+* Use QNames for TriG graph names
+ [#330](https://github.com/RDFLib/rdflib/issues/330)
+
+* \uXXXX escapes in Turtle/N3 were fixed
+ [#335](https://github.com/RDFLib/rdflib/issues/335)
+
+* A way to limit the number of triples retrieved from the
+ ```SPARQLStore``` was added
+ [#346](https://github.com/RDFLib/rdflib/pull/346)
+
+* Dots in localnames in Turtle
+ [#345](https://github.com/RDFLib/rdflib/issues/345)
+ [#336](https://github.com/RDFLib/rdflib/issues/336)
+
+* ```BNode``` as Graph's public ID
+ [#300](https://github.com/RDFLib/rdflib/issues/300)
+
+* Introduced ordering of ```QuotedGraphs```
+ [#291](https://github.com/RDFLib/rdflib/issues/291)
+
+2013/05/22 RELEASE 4.0.1
+========================
+
+Following RDFLib tradition, some bugs snuck into the 4.0 release.
+This is a bug-fixing release:
+
+* the new URI validation caused lots of problems, but is
+ nescessary to avoid ''RDF injection'' vulnerabilities. In the
+ spirit of ''be liberal in what you accept, but conservative in
+ what you produce", we moved validation to serialisation time.
+
+* the ```rdflib.tools``` package was missing from the
+ ```setup.py``` script, and was therefore not included in the
+ PYPI tarballs.
+
+* RDF parser choked on empty namespace URI
+ [#288](https://github.com/RDFLib/rdflib/issues/288)
+
+* Parsing from ```sys.stdin``` was broken
+ [#285](https://github.com/RDFLib/rdflib/issues/285)
+
+* The new IO store had problems with concurrent modifications if
+ several graphs used the same store
+ [#286](https://github.com/RDFLib/rdflib/issues/286)
+
+* Moved HTML5Lib dependency to the recently released 1.0b1 which
+ support python3
+
+2013/05/16 RELEASE 4.0
+======================
+
+This release includes several major changes:
+
+* The new SPARQL 1.1 engine (rdflib-sparql) has been included in
+ the core distribution. SPARQL 1.1 queries and updates should
+ work out of the box.
+
+ * SPARQL paths are exposed as operators on ```URIRefs```, these can
+ then be be used with graph.triples and friends:
+
+ ```py
+ # List names of friends of Bob:
+ g.triples(( bob, FOAF.knows/FOAF.name , None ))
+
+ # All super-classes:
+ g.triples(( cls, RDFS.subClassOf * '+', None ))
+ ```
+
+ * a new ```graph.update``` method will apply SPARQL update statements
+
+* Several RDF 1.1 features are available:
+ * A new ```DataSet``` class
+ * ```XMLLiteral``` and ```HTMLLiterals```
+ * ```BNode``` (de)skolemization is supported through ```BNode.skolemize```,
+ ```URIRef.de_skolemize```, ```Graph.skolemize``` and ```Graph.de_skolemize```
+
+* Handled of Literal equality was split into lexical comparison
+ (for normal ```==``` operator) and value space (using new ```Node.eq```
+ methods). This introduces some slight backwards incomaptible
+ changes, but was necessary, as the old version had
+ inconsisten hash and equality methods that could lead the
+ literals not working correctly in dicts/sets.
+ The new way is more in line with how SPARQL 1.1 works.
+ For the full details, see:
+
+ https://github.com/RDFLib/rdflib/wiki/Literal-reworking
+
+* Iterating over ```QueryResults``` will generate ```ResultRow``` objects,
+ these allow access to variable bindings as attributes or as a
+ dict. I.e.
+
+ ```py
+ for row in graph.query('select ... ') :
+ print row.age, row["name"]
+ ```
+
+* "Slicing" of Graphs and Resources as syntactic sugar:
+ ([#271](https://github.com/RDFLib/rdflib/issues/271))
+
+ ```py
+ graph[bob : FOAF.knows/FOAF.name]
+ -> generator over the names of Bobs friends
+ ```
+
+* The ```SPARQLStore``` and ```SPARQLUpdateStore``` are now included
+ in the RDFLib core
+
+* The documentation has been given a major overhaul, and examples
+ for most features have been added.
+
+
+Minor Changes:
+--------------
+
+* String operations on URIRefs return new URIRefs: ([#258](https://github.com/RDFLib/rdflib/issues/258))
+ ```py
+ >>> URIRef('http://example.org/')+'test
+ rdflib.term.URIRef('http://example.org/test')
+ ```
+
+* Parser/Serializer plugins are also found by mime-type, not just
+ by plugin name: ([#277](https://github.com/RDFLib/rdflib/issues/277))
+* ```Namespace``` is no longer a subclass of ```URIRef```
+* URIRefs and Literal language tags are validated on construction,
+ avoiding some "RDF-injection" issues ([#266](https://github.com/RDFLib/rdflib/issues/266))
+* A new memory store needs much less memory when loading large
+ graphs ([#268](https://github.com/RDFLib/rdflib/issues/268))
+* Turtle/N3 serializer now supports the base keyword correctly ([#248](https://github.com/RDFLib/rdflib/issues/248))
+* py2exe support was fixed ([#257](https://github.com/RDFLib/rdflib/issues/257))
+* Several bugs in the TriG serializer were fixed
+* Several bugs in the NQuads parser were fixed
+
+2013/03/01 RELEASE 3.4
+======================
+
+This release introduced new parsers for structured data in HTML.
+In particular formats: hturtle, rdfa, mdata and an auto-detecting
+html format were added. Thanks to Ivan Herman for this!
+
+This release includes a lot of admin maintentance - correct
+dependencies for different python versions, etc. Several py3 bugs
+were also fixed.
+
+This release drops python 2.4 compatability - it was just getting
+too expensive for us to maintain. It should however be compatible
+with any cpython from 2.5 through 3.3.
+
+* ```node.md5_term``` is now deprecated, if you use it let us know.
+
+* Literal.datatype/language are now read-only properties ([#226](https://github.com/RDFLib/rdflib/issues/226))
+* Serializing to file fails in py3 ([#249](https://github.com/RDFLib/rdflib/issues/249))
+* TriX serializer places two xmlns attributes on same element ([#250](https://github.com/RDFLib/rdflib/issues/250))
+* RDF/XML parser fails on when XML namespace is not explicitly declared ([#247](https://github.com/RDFLib/rdflib/issues/247))
+* Resource class should "unbox" Resource instances on add ([#215](https://github.com/RDFLib/rdflib/issues/215))
+* Turtle/N3 does not encode final quote of a string ([#239](https://github.com/RDFLib/rdflib/issues/239))
+* float Literal precision lost when serializing graph to turtle or n3 ([#237](https://github.com/RDFLib/rdflib/issues/237))
+* plain-literal representation of xsd:decimals fixed
+* allow read-only sleepycat stores
+* language tag parsing in N3/Turtle fixes to allow several subtags.
+
+2012/10/10 RELEASE 3.2.3
+========================
+
+Almost identical to 3.2.2
+A stupid bug snuck into 3.2.2, and querying graphs were broken.
+
+* Fixes broken querying ([#234](https://github.com/RDFLib/rdflib/issues/234))
+* graph.transitiveClosure now works with loops ([#206](https://github.com/RDFLib/rdflib/issues/206))
+
+2012/09/25 RELEASE 3.2.2
+========================
+
+This is mainly a maintenance release.
+
+This release should be compatible with python 2.4 through to 3.
+
+Changes:
+
+* Improved serialization/parsing roundtrip tests led to some fixes
+ of obscure parser/serializer bugs. In particular complex string
+ Literals in ntriples improved a lot.
+* The terms of a triple are now asserted to be RDFLib Node's in graph.add
+ This should avoid getting strings and other things in the store. ([#200](https://github.com/RDFLib/rdflib/issues/200))
+* Added a specific TurtleParser that does not require the store to be
+ non-formula aware. ([#214](https://github.com/RDFLib/rdflib/issues/214))
+* A trig-serializer was added, see:
+ http://www4.wiwiss.fu-berlin.de/bizer/trig/
+* BNode generation was made thread-safe ([#209](https://github.com/RDFLib/rdflib/issues/209))
+ (also fixed better by dzinxed)
+* Illegal BNode IDs removed from NT output: ([#212](https://github.com/RDFLib/rdflib/issues/212))
+* and more minor bug fixes that had no issues
+
+2012/04/24 RELEASE 3.2.1
+========================
+
+This is mainly a maintenance release.
+
+Changes:
+
+* New setuptools entry points for query processors and results
+
+* Literals constructed from other literals copy datatype/lang ([#188](https://github.com/RDFLib/rdflib/issues/188))
+* Relative URIs are resolved incorrectly after redirects ([#130](https://github.com/RDFLib/rdflib/issues/130))
+* Illegal prefixes in turtle output ([#161](https://github.com/RDFLib/rdflib/issues/161))
+* Sleepcat store unstable prefixes ([#201](https://github.com/RDFLib/rdflib/issues/201))
+* Consistent toPyton() for all node objects ([#174](https://github.com/RDFLib/rdflib/issues/174))
+* Better random BNode ID in multi-thread environments ([#185](https://github.com/RDFLib/rdflib/issues/185))
+
+2012/01/19 RELEASE 3.2.0
+========================
+
+Major changes:
+* Thanks to Thomas Kluyver, rdflib now works under python3,
+ the setup.py script automatically runs 2to3.
+
+* Unit tests were updated and cleaned up. Now all tests should pass.
+* Documentation was updated and cleaned up.
+
+* A new resource oriented API was added:
+ http://code.google.com/p/rdflib/issues/detail?id=166
+
+ Fixed many minor issues:
+ * http://code.google.com/p/rdflib/issues/detail?id=177
+ http://code.google.com/p/rdflib/issues/detail?id=129
+ Restored compatability with Python 2.4
+ * http://code.google.com/p/rdflib/issues/detail?id=158
+ Reworking of Query result handling
+ * http://code.google.com/p/rdflib/issues/detail?id=193
+ generating xml:base attribute in RDF/XML output
+* http://code.google.com/p/rdflib/issues/detail?id=180
+ serialize(format="pretty-xml") fails on cyclic links
+
+
+2011/03/17 RELEASE 3.1.0
+========================
+
+Fixed a range of minor issues:
+
+* http://code.google.com/p/rdflib/issues/detail?id=128
+
+ Literal.__str__ does not behave like unicode
+
+* http://code.google.com/p/rdflib/issues/detail?id=141
+
+ (RDFa Parser) Does not handle application/xhtml+xml
+
+* http://code.google.com/p/rdflib/issues/detail?id=142
+
+ RDFa TC #117: Fragment identifiers stripped from BASE
+
+* http://code.google.com/p/rdflib/issues/detail?id=146
+
+ Malformed literals produced when rdfa contains newlines
+
+* http://code.google.com/p/rdflib/issues/detail?id=152
+
+ Namespaces beginning with _ are invalid
+
+* http://code.google.com/p/rdflib/issues/detail?id=156
+
+ Turtle Files with a UTF-8 BOM fail to parse
+
+* http://code.google.com/p/rdflib/issues/detail?id=154
+
+ ClosedNamespace.__str__ returns URIRef not str
+
+* http://code.google.com/p/rdflib/issues/detail?id=150
+
+ IOMemory does not override open
+
+* http://code.google.com/p/rdflib/issues/detail?id=153
+
+ Timestamps with microseconds *and* "Z" timezone are not parsed
+
+* http://code.google.com/p/rdflib/issues/detail?id=118
+
+ DateTime literals with offsets fail to convert to Python
+
+* http://code.google.com/p/rdflib/issues/detail?id=157
+
+ Timestamps with timezone information are not parsed
+
+* http://code.google.com/p/rdflib/issues/detail?id=151
+
+ problem with unicode literals in rdflib.compare.graph_diff
+
+* http://code.google.com/p/rdflib/issues/detail?id=149
+
+ Sleepycat Store broken with create=False
+
+* http://code.google.com/p/rdflib/issues/detail?id=134
+
+ Would be useful if Graph.query could propagate kwargs to a
+
+ plugin processor
+
+* http://code.google.com/p/rdflib/issues/detail?id=133
+
+ Graph.connected exception when passed empty graph
+
+* http://code.google.com/p/rdflib/issues/detail?id=129
+
+ Not compatible with Python 2.4
+
+* http://code.google.com/p/rdflib/issues/detail?id=119
+
+ Support Python's set operations on Graph
+
+* http://code.google.com/p/rdflib/issues/detail?id=130
+
+ NT output encoding to utf-8 broken as it goes through
+
+ _xmlcharrefreplace
+
+* http://code.google.com/p/rdflib/issues/detail?id=121#c1
+
+ Store SPARQL Support
+
+
+2010/05/13 RELEASE 3.0.0
+========================
+
+Working test suite with all tests passing.
+
+Removed dependency on setuptools.
+
+(Issue #43) Updated Package and Module Names to follow
+conventions outlined in
+http://www.python.org/dev/peps/pep-0008/
+
+Removed SPARQL bits and non core plugins. They are mostly
+moving to http://code.google.com/p/rdfextras/ at least until
+they are stable.
+
+Fixed datatype for Literal(True).
+
+Fixed Literal to enforce contraint of having either a language
+or datatype but not both.
+
+Fixed Literal's repr.
+
+Fixed to Graph Add/Sub/Mul opterators.
+
+Upgraded RDFa parser to pyRdfa.
+
+Upgraded N3 parser to the one from CWM.
+
+Fixed unicode encoding issue involving N3Parser.
+
+N3 serializer improvments.
+
+Fixed HTTP content-negotiation
+
+Fixed Store.namespaces method (which caused a few issues
+depending on Store implementation being used.)
+
+Fixed interoperability issue with plugin module.
+
+Fixed use of Deprecated functionality.
+
+2009/03/30 RELEASE 2.4.1
+========================
+
+Fixed Literal comparison case involving Literal's with
+datatypes of XSD.base64Binary.
+
+Fixed case where XSD.date was matching before XSD.dateTime for
+datetime instances.
+
+Fixed jython interoperability issue (issue #53).
+
+Fixed Literal repr to handle apostrophes correctly (issue #28).
+
+Fixed Literal's repr to be consistent with its ```__init__``` (issue #33).
+
+
+2007/04/04 RELEASE 2.4.0
+========================
+
+Improved Literal comparison / equality
+
+Sparql cleanup.
+
+getLiteralValue now returns the Literal object instead of the
+result of toPython(). Now that Literals override a good
+coverage of comparison operators, they should be passed around
+as first class objects in the SPARQL evaluation engine.
+
+Added support for session bnodes re: sparql
+
+Fixed prolog reduce/reduce conflict. Added Py_None IncRefs
+where they were being passed into Python method invokations
+(per drewp's patch)
+
+Fixed sparql queries involving empty namespace prefix.
+
+Fixed the selected variables sparql issue
+
+Fixed support in SPARQL queries.
+
+Fixed involving multiple unions and queries are nested more
+than one level (bug in _getAllVariables causing failure when
+parent.top is None)
+
+Fixed test_sparql_equals.py.
+
+Fixed sparql json result comma errors issue.
+
+Fixed test_sparql_json_results.py (SELECT * variables out of
+order)
+
+Added a 4Suite-based SPARQL XML Writer implementation. If
+4Suite is not installed, the fallback python saxutils is used
+instead
+
+applied patch from
+http://rdflib.net/issues/2007/02/23/bugs_in_rdflib.sparql.queryresult/issue
+
+The restriction on GRAPH patterns with variables has been
+relieved a bit to allow such usage when the variable is
+provided as an initial binding
+
+Fix for OPTIONAL patterns. P1 OPT P2, where P1 and P2 shared
+variables which were bound to BNodes were not unifying on
+these BNode variable efficiently / correctly. The fix was to
+add bindings for 'stored' BNodes so they aren't confused for
+wildcards
+
+
+
+
+Added support to n3 parser for retaining namespace bindings.
+
+Fixed several RDFaParser bugs.
+
+Added serializer specific argument support.
+
+Fixed a few PrettyXMLSerializer issues and added a max_depth
+option.
+
+Fixed some TurtleSerializer issues.
+
+Fixed some N3Serializer issues.
+
+
+
+Added support easy_install
+
+added link to long_descriptin for easy_install -U rdflib==dev
+to work; added download_url back
+
+added continuous-releases-using-subversion bit
+
+
+
+Added rdflib_tools package
+ Added rdfpipe
+ Added initial EARLPluging
+
+
+
+Improved test running... using nose... added tests
+
+Exposed generated test cases for nose to find.
+added bit to configure 'setup.py nosetests' to run doc tests
+
+added nose test bits
+
+
+
+Added md5_term_hash method to terms.
+
+Added commit_pending_transaction argument to Graph's close
+method.
+
+Added DeprecationWarning to rdflib.constants
+
+Added a NamespaceDict class for those who want to avoid the
+Namespace as subclass of URIRef issues
+
+Added bind function
+
+Fixed type of Namespace re: URIRef vs. unicode
+
+Improved ValueError message
+
+Changed value method's any argument to default to True
+
+Changed ```__repr__``` to always reflect that it's an rdf.Literal --
+as this is the case even though we now have it acting like the
+corresponding type in some casses
+
+A DISTINCT was added to the SELECT clause to ensure duplicate
+triples are not returned (an RDF graph is a set of triples) -
+which can happen for certain join expressions.
+
+Support for ConditionalAndExpressionList and
+RelationalExpressionList (|| and && operators in FILTER)
+
+Fixed context column comparison. The hash integer was being
+compared with 'F' causing a warning:Warning: Truncated
+incorrect DOUBLE value: 'F'
+
+applied patch in
+http://rdflib.net/issues/2006/12/13/typos_in_abstractsqlstore.py/issue
+
+fix for
+http://rdflib.net/issues/2006/12/07/problems_with_graph.seq()_when_sequences_contain_more_than_9_items./issue
+
+
+
+
+
+General code cleanup (removing redundant imports, changing
+relative imports to absolute imports etc)
+
+Removed usage of deprecated bits.
+
+Added a number of test cases.
+
+Added DeprecationWarning for save method
+
+refactoring of GraphPattern
+
+ReadOnlyGraphAggregate uses Graph constructor properly to
+setup (optionally) a common store
+
+
+Fixed bug with . (fullstop) in localname parts.
+
+Changed Graph's value method to return None instead of raising
+an AssertionError.
+
+Fixed conversion of (exiplicit) MySQL ports to integers.
+
+Fixed MySQL store so it properly calculates ```__len__``` of
+individual Graphs
+
+Aligned with how Sleepycat is generating events (remove events
+are expressed in terms of interned strings)
+
+Added code to catch unpickling related exceptions
+
+Added BerkeleyDB store implementation.
+
+Merged TextIndex from michel-events branch.
+
+
+2006/10/15 RELEASE 2.3.3
+========================
+
+Added TriXParser, N3Serializer and TurtleSerializer.
+
+Added events to store interface: StoreCreated, TripleAdded and
+TripleRemoved.
+
+Added Journal Reader and Writer.
+
+Removed Sleepycat level journaling.
+
+Added support for triple quoted Literal's.
+
+Fixed some corner cases with Literal comparison.
+
+Fixed PatternResolution for patterns that return contexts only.
+
+Fixed NodePickler not to choke on unhashable objects.
+
+Fixed Namespace's ```__getattr__``` hack to ignore names starting
+with __
+
+Added SPARQL != operator.
+
+Fixed query result ```__len__``` (more efficient).
+
+Fixed and improved RDFa parser.
+
+redland patches from
+http://rdflib.net/pipermail/dev/2006-September/000069.html
+
+various patches for the testsuite -
+http://rdflib.net/pipermail/dev/2006-September/000069.html
+
+
+2006/08/01 RELEASE 2.3.2
+========================
+
+Added SPARQL query support.
+
+Added XSD to/from Python datatype support to Literals.
+
+Fixed ConjunctiveGraph so that it is a proper subclass of Graph.
+
+Added Deprecation Warning when BackwardCompatGraph gets used.
+
+Added RDFa parser.
+
+Added Collection Class for working with RDF Collections.
+
+Added method to Graph for testing connectedness
+
+Fixed bug in N3 parser where identical BNodes were not being combined.
+
+Fixed literal quoting in N3 serializer.
+
+Fixed RDF/XML serializer to skip over N3 bits.
+
+Changed Literal and URIRef instanciation to catch
+UnicodeDecodeErrors - which were being thrown when the default
+decoding method (ascii) was hitting certain characters.
+
+Changed Graph's bind method to also override the binding in
+the case of an existing generated bindings.
+
+Added FOPLRelationalModel - a set of utility classes that
+implement a minimal Relational Model of FOPL implemented as a
+SQL database (uses identifier/value interning and integer
+half-md5-hashes for space and index efficiency).
+
+Changed MySQL store to use FOPLRelationalModel plus fixes and
+improvements.
+
+Added more test cases.
+
+Cleaned up source code to follow pep8 / pep257.
+
+
+2006/02/27 RELEASE 2.3.1
+========================
+
+Added save method to BackwardCompatibleGraph so that
+example.py etc work again.
+
+Applied patch from Drew Perttula to add local_time_zone
+argument to util's date_time method.
+
+Fixed a relativize bug in the rdf/xml serializer.
+
+Fixed NameError: global name 'URIRef' is not defined error in
+Sleepycat.py by adding missing import.
+
+Applied patch for Seq to sort list by integer, added by Drew
+Hess.
+
+Added a preserve_bnode_ids option to rdf/xml parser.
+
+Applied assorted patches for tests (see
+http://tracker.asemantics.com/rdflib/ticket/8 )
+
+Applied redland.diff (see
+http://tracker.asemantics.com/rdflib/ticket/9 )
+
+Applied changes specified
+http://tracker.asemantics.com/rdflib/ticket/7
+
+Added a set method to Graph.
+
+Fixed RDF/XML serializer so that it does not choke on n3 bits
+(rather it'll just ignore them)
+
+
+2005/12/23 RELEASE 2.3.0
+========================
+
+See http://rdflib.net/2.3.0/ for most up-to-date release notes
+
+Added N3 support to Graph and Store.
+
+Added Sean's n3p parser, and ntriples parser.
+
+Sleepycat implementation has been revamped in the process of
+expanding it to support the new requirements n3
+requirements. It also now persists a journal -- more to come.
+
+detabified source files.
+
+Literal and parsers now distinguish between datatype of None and datatype of "".
+
+Store-agnostic 'fallback' implementation of REGEX matching
+(inefficient but provides the capability to stores that don't
+support it natively). Implemented as a 'wrapper' around any
+Store which replaces REGEX terms with None (before dispatching
+to the store) and whittles out results that don't match the
+given REGEX term expression(s).
+
+Store-agnostic 'fallback' implementation of transactional
+rollbacks (also inefficient but provides the capablity to
+stores that don't support it natively). Implemented as a
+wrapper that tracks a 'thread-safe' list of reversal
+operations (for every add, track the remove call that reverts
+the store, and vice versa). Upon store.rollback(), execute the
+reverse operations. However, this doesn't guarantee
+durability, since if the system fails before the rollbacks are
+all executed, the store will remain in an invalid state, but
+it provides Atomicity in the best case scenario.
+
+
+2005/10/10 RELEASE 2.2.3
+========================
+
+Fixed Sleepycat backend to commit after an add and
+remove. This should help just a bit with those unclean
+shutdowns ;)
+
+Fixed use of logging so that it does not mess with the root
+logger. Thank you, Arve, for pointing this one out.
+
+Fixed Graph's value method to have default for subject in
+addition to predicate and object.
+
+Fixed Fourthought backend to be consistent with interface. It
+now supports an empty constructor and an open method that
+takes a configuration string.
+
+
+2005/09/10 RELEASE 2.2.2
+========================
+
+Applied patch from inkel to add encoding argument to all
+serialization related methods.
+
+Fixed XMLSerializer bug regarding default namespace bindings.
+
+Fixed namespace binding bug involving binding a second default
+namespace.
+
+Applied patch from Gunnar AAstrand Grimnes to add context
+support to ```__iadd__``` on Graph. (Am considering the lack of
+context support a bug. Any users currently using ```__iadd__```, let
+me know if this breaks any of your code.)
+
+Added Fourthought backend contributed by Chimezie Ogbuji.
+
+Fixed a RDF/XML parser bug relating to XMLLiteral and
+escaping.
+
+Fixed setup.py so that install does not try to uninstall
+(rename_old) before installing; there's now an uninstall
+command if one needs to uninstall.
+
+
+2005/08/25 RELEASE 2.2.1
+========================
+
+Fixed issue regarding Python2.3 compatibility.
+
+Fixed minor issue with URIRef's absolute method.
+
+
+2005/08/12 RELEASE 2.1.4
+========================
+
+Added optional base argument to URIRef.
+
+Fixed bug where load and parse had inconsistent behavior.
+
+Added a FileInputSource.
+
+Added skeleton sparql parser and test framework.
+
+Included pyparsing (pyparsing.sourceforge.net) for sparql parsing.
+
+Added attribute support to namespaces.
+
+
+2005/06/28 RELEASE 2.1.3
+========================
+
+Added Ivan's sparql-p implementation.
+
+Literal is now picklable.
+
+Added optional base argument to serialize methods about which to relativize.
+
+Applied patch to remove some dependencies on Python 2.4
+features.
+
+Fixed BNode's n3 serialization bug (recently introduced).
+
+Fixed a collections related bug.
+
+
+2005/05/13 RELEASE 2.1.2
+========================
+
+Added patch from Sidnei da Silva that adds a sqlobject based backend.
+
+Fixed bug in PrettyXMLSerializer (rdf prefix decl was missing sometimes)
+
+Fixed bug in RDF/XML parser where empty collections where
+causing exceptions.
+
+
+2005/05/01 RELEASE 2.1.1
+========================
+
+Fixed a number of bugs relating to 2.0 backward compatibility.
+
+Fixed split_uri to handle URIs with _ in them properly.
+
+Fixed bug in RDF/XML handler's absolutize that would cause some URIRefs to end in ##
+
+Added check_context to Graph.
+
+Added patch the improves IOMemory implementation.
+
+
+2005/04/12 RELEASE 2.1.0
+========================
+
+Merged TripleStore and InformationStore into Graph.
+
+Added plugin support (or at least cleaned up, made consistent the
+plugin support that existed).
+
+Added value and seq methods to Graph.
+
+Renamed prefix_mapping to bind.
+
+Added namespaces method that is a generator over all prefix,
+namespace bindings.
+
+Added notion of NamespaceManager.
+
+Added couple new backends, IOMemory and ZODB.
+
+
+2005/03/19 RELEASE 2.0.6
+========================
+
+Added pretty-xml serializer (inlines BNodes where possible,
+typed nodes, Collections).
+
+Fixed bug in NTParser and n3 methods where not all characters
+where being escaped.
+
+Changed label and comment methods to return default passed in
+when there is no label or comment. Moved methods to Store
+Class. Store no longer inherits from Schema.
+
+Fixed bug involving a case with rdf:about='#'
+
+Changed InMemoryBackend to update third index in the same style it
+does the first two.
+
+
+2005/01/08 RELEASE 2.0.5
+========================
+
+Added publicID argument to Store's load method.
+
+Added RDF and RDFS to top level rdflib package.
+
+
+2004/10/14 RELEASE 2.0.4
+========================
+
+Removed unfinished functionality.
+
+Fixed bug where another prefix other than rdf was getting
+defined for the rdf namespace (causing an assertion to fail).
+
+Fixed bug in serializer where nodeIDs were not valid NCNames.
+
+
+2004/04/21 RELEASE 2.0.3
+========================
+
+Added missing "from __future__ import generators" statement to
+InformationStore.
+
+Simplified RDF/XML serializer fixing a few bugs involving
+BNodes.
+
+Added a reset method to RDF/XML parser.
+
+Changed 'if foo' to "if foo is not None" in a few places in
+the RDF/XML parser.
+
+Fully qualified imports in rdflib.syntax {parser, serializer}.
+
+Context now goes through InformationStore (was bypassing it
+going directly to backend).
+
+
+2004/03/22 RELEASE 2.0.2
+========================
+
+Improved performance of Identifier equality tests.
+
+Added missing "from __future__ import generators" statements
+needed to run on Python2.2.
+
+Added alternative to shlib.move() if it isn't present.
+
+Fixed bug that occured when specifying a backend to
+InformationStore's constructor.
+
+Fixed bug recently introduced into InformationStore's remove
+method.
+
+
+2004/03/15 RELEASE 2.0.1
+========================
+
+Fixed a bug in the SleepyCatBackend multi threaded concurrency
+support. (Tested fairly extensively under the following
+conditions: multi threaded, multi process, and both).
+
+> NOTE: fix involved change to database format -- so 2.0.1 will not be
+> able to open databases created with 2.0.0
+
+Removed the use of the Concurrent wrapper around
+InMemoryBackend and modified InMemoryBackend to handle
+concurrent requests. (Motivated by Concurrent's poor
+performance on bigger TripleStores.)
+
+Improved the speed of len(store) by making backends
+responsible for implementing ```__len__```.
+
+Context objects now have a identifier property.
+
+
+2004/03/10 RELEASE 2.0.0
+========================
+
+Fixed a few bugs in the SleepyCatBackend multi process
+concurrency support.
+
+Removed rdflib.Resource
+
+Changed remove to now take a triple pattern and removed
+remove_triples method.
+
+Added ```__iadd__``` method to Store in support of store +=
+another_store.
+
+
+2004/01/04 RELEASE 1.3.2
+========================
+
+Added a serialization dispatcher.
+
+Added format arg to save method.
+
+Store now remembers prefix/namespace bindings.
+
+Backends are now more pluggable
+
+...
+
+2003/10/14 RELEASE 1.3.1
+========================
+
+Fixed bug in serializer where triples where only getting
+serialized the first time.
+
+Added type checking for contexts.
+
+Fixed bug that caused comparisons with a Literal to fail when
+the right hand side was not a string.
+
+Added DB_INIT_CDB flag to SCBacked for supporting multiple
+reader/single writer access
+
+Changed rdf:RDF to be optional to conform with latest spec.
+
+Fixed handling of XMLLiterals
+
+
+2003/04/40 RELEASE 1.3.0
+========================
+
+Removed bag_id support and added it to OLD_TERMS.
+
+Added a double hash for keys in SCBacked.
+
+Fixed _HTTPClient so that it no longer removes metadata about
+a context right after it adds it.
+
+Added a KDTreeStore and RedlandStore backends.
+
+Added a StoreTester.
+
+
+2003/02/28 RELEASE 1.2.4
+========================
+
+Fixed bug in SCBackend where language and datatype information
+where being ignored.
+
+Fixed bug in transitive_subjects.
+
+Updated some of the test cases that where not up to date.
+
+async_load now adds more http header and error information to
+the InformationStore.
+
+
+2003/02/11 RELEASE 1.2.3
+========================
+
+Fixed bug in load methods where relative URLs where not being
+absolutized correctly on Windows.
+
+Fixed serializer so that it throws an exception when trying to
+serialize a graph with a predicate that can not be split.
+
+
+2003/02/07 RELEASE 1.2.2
+========================
+
+Added an exists method to the BackwardCompatibility mixin.
+
+Added versions of remove, remove_triples and triples methods
+to the BackwardCompatility mixin for TripleStores that take an
+s, p, o as opposed to an (s, p, o).
+
+
+2003/02/03 RELEASE 1.2.1
+========================
+
+Added support for parsing XMLLiterals.
+
+Added support for proper charmod checking (only works in
+Python2.3).
+
+Fixed remaining rdfcore test cases that where not passing.
+
+Fixed windows bug in AbstractInformationStore's run method.
+
+
+2003/01/02 RELEASE 1.2.0
+========================
+
+Added systemID, line #, and column # to error messages.
+
+BNode prefix is now composed of ascii_letters instead of letters.
+
+Added a bsddb backed InformationStore.
+
+Added an asyncronous load method, methods for scheduling context
+updates, and a run method.
+
+
+2002/12/16 RELEASE 1.1.5
+========================
+
+Introduction of InformationStore, a TripleStore with the
+addition of context support.
+
+Resource ```__getitem__``` now returns object (no longer returns a
+Resource for the object).
+
+Fixed bug in parser that was introduced in last release
+regaurding unqualified names.
+
+
+2002/12/10 RELEASE 1.1.4
+========================
+
+Interface realigned with last stable release.
+
+Serializer now uses more of the abbreviated forms where
+possible.
+
+Parser optimized and cleaned up.
+
+Added third index to InMemoryStore.
+
+The load and parse methods now take a single argument.
+
+Added a StringInputSource for to support parsing from strings.
+
+Renamed rdflib.BTreeTripleStore.TripleStore to
+rdflib.BTreeTripleStore.BTreeTripleStore.
+
+Minor reorganization of mix-in classes.
+
+
+2002/12/03 RELEASE 1.1.3
+========================
+
+BNodes now created with a more unique identifier so BNodes
+from different sessions do not collide.
+
+Added initial support for XML Literals (for now they are
+parsed into Literals).
+
+Resource is no longer a special kind of URIRef.
+
+Resource no longer looks at range to determine default return
+type for ```__getitem__```. Instead there is now a get(predicate, default)
+method.
+
+
+2002/11/21 RELEASE 1.1.2
+========================
+
+Fixed Literal's ```__eq__``` method so that Literal('foo')=='foo' etc.
+
+Fixed Resource's ```__setitem__``` method so that it does not raise
+a dictionary changed size while iterating exception.
+
+
+2002/11/09 RELEASE 1.1.1
+========================
+
+Resource is now a special kind of URIRef
+
+Resource's ```__getitem__``` now looks at rdfs:range to determine
+return type in default case.
+
+
+
+2002/11/05 RELEASE 1.1.0
+========================
+
+# A new development branch
+
+Cleaned up interface and promoted it to SIR: Simple Interface
+for RDF.
+
+Updated parser to use SAX2 interfaces instead of using expat directly.
+
+Added BTreeTripleStore, a ZODB BTree TripleStore backend. And
+a default pre-mixed TripleStore that uses it.
+
+Synced with latest (Editor's draft) RDF/XML spec.
+
+Added datatype support.
+
+Cleaned up interfaces for load/parse: removed generate_path
+from loadsave andrenamed parse_URI to parse.
+
+
+2002/10/08 RELEASE 0.9.6
+========================
+
+
+# The end of a development branch
+
+BNode can now be created with specified value.
+
+Literal now has a language attribute.
+
+Parser now creates Literals with language attribute set
+appropriately as determined by xml:lang attributes.
+
+
+TODO: Serializer-Literals-language attribute
+
+TODO: Change ```__eq__``` so that Literal("foo")=="foo" etc
+
+TripleStores now support "in" operator.
+For example: if (s, p, o) in store: print "Found ", s, p, o
+
+Added APIs/object for working at level of a Resource. NOTE:
+This functionality is still experimental
+
+Consecutive Collections now parse correctly.
+
+2002/08/06 RELEASE 0.9.5
+========================
+
+
+Added support for rdf:parseType="Collection"
+
+Added items generator for getting items in a Collection
+
+Renamed rdflib.triple_store to rdflib.TripleStore to better follow
+python style conventions.
+
+Added an Identifier Class
+
+Moved each node into its own Python module.
+
+Added rdflib.util with a first and uniq function.
+
+Added a little more to example.py
+
+Removed generate_uri since we have BNodes now.
+
+
+2002/07/29 RELEASE 0.9.4
+========================
+
+
+Added support for proposed rdf:nodeID to both the parser and
+serializer.
+
+Reimplemented serializer which now nests things where
+possible.
+
+Added partial support for XML Literal parseTypes.
+
+
+2002/07/16 RELEASE 0.9.3
+========================
+
+
+Fixed bug where bNodes where being created for nested property
+elements when they where not supposed to be.
+
+Added lax mode that will convert rdf/xml files that contain bare
+IDs etc. Also, lax mode will only report parse errors instead of
+raising exceptions.
+
+Added missing check for valid attribute names in the case of
+production 5.18 of latest WD spec.
+
+
+2002/07/05 RELEASE 0.9.2
+========================
+
+
+Added missing constants for SUBPROPERTYOF, ISDEFINEDBY.
+
+Added test case for running all of the rdf/xml test cases.
+
+Reimplemented rdf/xml parser to conform to latest WD.
+
+
+2002/06/10 RELEASE 0.9.1
+========================
+
+
+There is now a remove and a remove_triples (no more overloaded
+remove).
+
+Layer 2 has been merged with layer 1 since there is no longer a
+need for them to be separate layers.
+
+The generate_uri method has moved to LoadSave since triple stores
+do not have a notion of a uri. [Also, with proper bNode support on
+its way the need for a generate_uri might not be as high.]
+
+Fixed bug in node's n3 function: URI -> URIRef.
+
+Replaced string based exceptions with class based exceptions.
+
+Added PyUnit TestCase for parser.py
+
+Added N-Triples parser.
+
+Added ```__len__``` and ```__eq__``` methods to store interface.
+
+
+2002/06/04 RELEASE 0.9.0
+========================
+
+Initial release after being split from redfootlib.
diff --git a/testbed/RDFLib__rdflib/CONTRIBUTORS b/testbed/RDFLib__rdflib/CONTRIBUTORS
new file mode 100644
index 0000000000000000000000000000000000000000..51987b61e6bd4e9037ba8e916ef79217d436c2c8
--- /dev/null
+++ b/testbed/RDFLib__rdflib/CONTRIBUTORS
@@ -0,0 +1,30 @@
+Aaron Swartz
+Andrew Eland
+Andrew Kuchling
+Arve Knudsen
+Chimezie Ogbuji
+Daniel Krech
+David H Jones
+Drew Perttula
+Elias Torres
+Gerhard Weis
+Graham Higgins
+Graham Klyne
+Gunnar AAstrand Grimnes
+Ivan Herman
+Jeroen van der Ham
+Joern Hees
+Kendall Clark
+Leandro López
+Lucio Torre
+Michel Pelletier
+Nacho Barrientos Arias
+Niklas Lindström
+Phil Dawes
+Phillip Pearson
+Ron Alford
+Sidnei da Silva
+Simon McVittie
+Stefan Niederhauser
+Thomas Kluyver
+William Waites
diff --git a/testbed/RDFLib__rdflib/LICENSE b/testbed/RDFLib__rdflib/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..38c0f03a0721e65bae1a7995514511ba5e4e72bf
--- /dev/null
+++ b/testbed/RDFLib__rdflib/LICENSE
@@ -0,0 +1,33 @@
+LICENSE AGREEMENT FOR RDFLIB
+------------------------------------------------
+Copyright (c) 2002-2017, RDFLib Team
+See CONTRIBUTORS and http://github.com/RDFLib/rdflib
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided
+with the distribution.
+
+ * Neither the name of Daniel Krech nor the names of its
+contributors may be used to endorse or promote products derived
+from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testbed/RDFLib__rdflib/MANIFEST.in b/testbed/RDFLib__rdflib/MANIFEST.in
new file mode 100644
index 0000000000000000000000000000000000000000..d48534bd1f3d9341e5d58a8d1e459d85a9929ec0
--- /dev/null
+++ b/testbed/RDFLib__rdflib/MANIFEST.in
@@ -0,0 +1,13 @@
+include CHANGELOG.md
+include LICENSE
+include README.md
+include CONTRIBUTORS
+include ez_setup.py
+include skiptests.list
+recursive-include rdflib *.py
+recursive-include examples *.py
+include run_tests.py
+graft test
+graft docs
+prune docs/_build
+global-exclude *.pyc *$py.class
diff --git a/testbed/RDFLib__rdflib/README.md b/testbed/RDFLib__rdflib/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..eb33567995bfa8e100edf01fd5612f6278e26c40
--- /dev/null
+++ b/testbed/RDFLib__rdflib/README.md
@@ -0,0 +1,103 @@
+RDFLib
+======
+[](https://travis-ci.org/RDFLib/rdflib)
+[](https://coveralls.io/r/RDFLib/rdflib?branch=master)
+[](https://github.com/RDFLib/rdflib/stargazers)
+[](https://pypi.python.org/pypi/rdflib)
+[](https://pypi.python.org/pypi/rdflib)
+
+
+RDFLib is a Python library for working with RDF, a simple yet
+powerful language for representing information as graphs.
+
+RDFLib may be installed with pip (use sudo as required):
+
+ $ pip install rdflib
+
+Alternatively manually download the package from the Python Package
+Index (PyPI) at https://pypi.python.org/pypi/rdflib
+
+The current version of RDFLib is 4.2.2, see the ``CHANGELOG.md``
+file for what's new.
+
+
+Getting Started
+---------------
+
+RDFLib aims to be a pythonic RDF API, a Graph is a python collection
+of RDF Subject,Predicate,Object Triples:
+
+```python
+import rdflib
+g=rdflib.Graph()
+g.load('http://dbpedia.org/resource/Semantic_Web')
+
+for s,p,o in g:
+ print(s, p, o)
+```
+
+The components of the triples are URIs (resources) or Literals
+(values), URIs are grouped together by *namespace*, common namespaces are
+included in RDFLib:
+
+```python
+
+semweb=rdflib.URIRef('http://dbpedia.org/resource/Semantic_Web')
+type=g.value(semweb, rdflib.RDFS.label)
+```
+
+Where `rdflib.RDFS` is the RDFS Namespace, `graph.value` returns an
+object of the triple-pattern given (or an arbitrary one if more
+exist). New Namespaces can also be defined:
+
+```python
+
+dbpedia=rdflib.Namespace('http://dbpedia.org/ontology/')
+
+abstracts=list(x for x in g.objects(semweb, dbpedia['abstract']) if x.language=='en')
+```
+
+See also [./examples](./examples)
+
+
+Features
+--------
+
+The library contains parsers and serializers for RDF/XML, N3,
+NTriples, N-Quads, Turtle, TriX, RDFa and Microdata.
+
+The library presents a Graph interface which can be backed by
+any one of a number of Store implementations.
+
+This core RDFLib package includes store implementations for
+in memory storage and persistent storage on top of the Berkeley DB.
+
+A SPARQL 1.1 implementation is included - supporting SPARQL 1.1 Queries and Update statements.
+
+RDFLib is open source and is maintained on [GitHub](https://github.com/RDFLib/rdflib/). RDFLib releases, current and previous
+are listed on [PyPI](https://pypi.python.org/pypi/rdflib/)
+
+RDFLib has a plugin-architecture for store-implementation, as well as parsers/serializers, several other projects exist which extend RDFLib features:
+
+ * [rdflib-jsonld](https://github.com/RDFLib/rdflib-jsonld) - Serializer and parser for [json-ld](http://json-ld.org)
+
+Support
+-------
+
+More information is available on the project webpage:
+
+https://github.com/RDFLib/rdflib/
+
+The documentation can be built by doing::
+
+ $ python setup.py build_sphinx
+
+And is also available from ReadTheDocs:
+
+https://rdflib.readthedocs.io
+
+Support is available through the rdflib-dev group:
+
+https://groups.google.com/group/rdflib-dev
+
+and on the IRC channel #rdflib on the freenode.net server
diff --git a/testbed/RDFLib__rdflib/requirements.txt b/testbed/RDFLib__rdflib/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..215e257a8e5dc238283a23a3bd3fb3df7f4d47bf
--- /dev/null
+++ b/testbed/RDFLib__rdflib/requirements.txt
@@ -0,0 +1,7 @@
+flake8
+html5lib
+isodate
+pyparsing
+requests
+six
+doctest-ignore-unicode
diff --git a/testbed/RDFLib__rdflib/run_tests.py b/testbed/RDFLib__rdflib/run_tests.py
new file mode 100644
index 0000000000000000000000000000000000000000..77bc9fec26cacf3c754859ddb1cbe0d985150ee7
--- /dev/null
+++ b/testbed/RDFLib__rdflib/run_tests.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Testing with Nose
+=================
+
+This test runner uses Nose for test discovery and running. It uses the argument
+spec of Nose, but with some options pre-set. To begin with, make sure you have
+Nose installed, e.g.:
+
+ $ pip nose doctest-ignore-unicode
+
+For daily test runs, use:
+
+ $ ./run_tests.py
+
+If you supply attributes, the default ones defined in ``DEFAULT_ATTRS`` will be
+ignored. So to run e.g. all tests marked ``slowtest`` or ``non_standard_dep``,
+do:
+
+ $ ./run_tests.py -a slowtest,non_standard_dep
+
+See for furher details. An excellent
+article is also available at .
+
+Note that this is just a convenience script. You can use ``nosetests`` directly
+if it's on $PATH, with the difference that you have to supply the options
+pre-set here manually.
+
+Coverage
+========
+
+If ``coverage.py`` is placed in $PYTHONPATH, it can be used to create coverage
+information (using the built-in coverage plugin of Nose) if the default
+option "--with-coverage" is supplied (which also enables some additional
+coverage options).
+
+See for details.
+
+"""
+from __future__ import print_function
+
+
+NOSE_ARGS = [
+ '--with-doctest',
+ '--doctest-extension=.doctest',
+ '--doctest-tests',
+ # '--with-EARL',
+]
+
+COVERAGE_EXTRA_ARGS = [
+ '--cover-package=rdflib',
+ '--cover-inclusive',
+]
+
+DEFAULT_LOCATION = '--where=./'
+
+DEFAULT_ATTRS = [] # ['!known_issue', '!sparql']
+
+DEFAULT_DIRS = ['test', 'rdflib']
+
+
+if __name__ == '__main__':
+
+ from sys import argv, exit, stderr
+ try:
+ import nose
+ except ImportError:
+ print("""\
+ Requires Nose. Try:
+
+ $ sudo easy_install nose
+
+ Exiting. """, file=stderr)
+ exit(1)
+
+
+ if '--with-coverage' in argv:
+ try:
+ import coverage
+ except ImportError:
+ print("No coverage module found, skipping code coverage.", file=stderr)
+ argv.remove('--with-coverage')
+ else:
+ NOSE_ARGS += COVERAGE_EXTRA_ARGS
+
+
+ if True not in [a.startswith('-a') or a.startswith('--attr=') for a in argv]:
+ argv.append('--attr=' + ','.join(DEFAULT_ATTRS))
+
+ if not [a for a in argv[1:] if not a.startswith('-')]:
+ argv += DEFAULT_DIRS # since nose doesn't look here by default..
+
+ if not [a for a in argv if a.startswith('--where=')]:
+ argv += [DEFAULT_LOCATION]
+
+ finalArgs = argv + NOSE_ARGS
+ print("Running nose with:", " ".join(finalArgs[1:]))
+ nose.run_exit(argv=finalArgs)
diff --git a/testbed/RDFLib__rdflib/setup.cfg b/testbed/RDFLib__rdflib/setup.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..535ee3107393afe54acc523d0bfa872deb3d62d3
--- /dev/null
+++ b/testbed/RDFLib__rdflib/setup.cfg
@@ -0,0 +1,8 @@
+[nosetests]
+
+attr=!known_issue,!non_core,!performancetest
+verbosity=1
+with-doctest=1
+with-doctest-ignore-unicode=1
+doctest-options=+IGNORE_UNICODE
+exclude=rdflib.plugins.sparql.paths|rdflib.extras.external_graph_libs
diff --git a/testbed/RDFLib__rdflib/setup.py b/testbed/RDFLib__rdflib/setup.py
new file mode 100644
index 0000000000000000000000000000000000000000..9859360e00ed74bdb314ba3708d5c1965f05de58
--- /dev/null
+++ b/testbed/RDFLib__rdflib/setup.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+
+import os
+import re
+from setuptools import setup, find_packages
+
+kwargs = {}
+kwargs['install_requires'] = [ 'six', 'isodate', 'pyparsing']
+kwargs['tests_require'] = ['html5lib', 'networkx']
+kwargs['test_suite'] = "nose.collector"
+kwargs['extras_require'] = {'html': ['html5lib']}
+
+def find_version(filename):
+ _version_re = re.compile(r'__version__ = "(.*)"')
+ for line in open(filename):
+ version_match = _version_re.match(line)
+ if version_match:
+ return version_match.group(1)
+
+version = find_version('rdflib/__init__.py')
+
+packages = find_packages(exclude=('examples*', 'test*'))
+
+if os.environ.get('READTHEDOCS', None):
+ # if building docs for RTD
+ # install examples, to get docstrings
+ packages.append("examples")
+
+setup(
+ name='rdflib',
+ version=version,
+ description="RDFLib is a Python library for working with RDF, a "
+ "simple yet powerful language for representing information.",
+ author="Daniel 'eikeon' Krech",
+ author_email="eikeon@eikeon.com",
+ maintainer="RDFLib Team",
+ maintainer_email="rdflib-dev@google.com",
+ url="https://github.com/RDFLib/rdflib",
+ license="BSD-3-Clause",
+ platforms=["any"],
+ classifiers=[
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "License :: OSI Approved :: BSD License",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Operating System :: OS Independent",
+ "Natural Language :: English",
+ ],
+ long_description="""\
+RDFLib is a Python library for working with
+RDF, a simple yet powerful language for representing information.
+
+The library contains parsers and serializers for RDF/XML, N3,
+NTriples, Turtle, TriX, RDFa and Microdata . The library presents
+a Graph interface which can be backed by any one of a number of
+Store implementations. The core rdflib includes store
+implementations for in memory storage, persistent storage on top
+of the Berkeley DB, and a wrapper for remote SPARQL endpoints.
+
+A SPARQL 1.1 engine is also included.
+
+If you have recently reported a bug marked as fixed, or have a craving for
+the very latest, you may want the development version instead:
+
+ pip install git+https://github.com/rdflib/rdflib
+
+
+Read the docs at:
+
+ http://rdflib.readthedocs.io
+
+ """,
+ packages = packages,
+ entry_points = {
+ 'console_scripts': [
+ 'rdfpipe = rdflib.tools.rdfpipe:main',
+ 'csv2rdf = rdflib.tools.csv2rdf:main',
+ 'rdf2dot = rdflib.tools.rdf2dot:main',
+ 'rdfs2dot = rdflib.tools.rdfs2dot:main',
+ 'rdfgraphisomorphism = rdflib.tools.graphisomorphism:main',
+ ],
+ },
+
+ **kwargs
+ )
diff --git a/testbed/RDFLib__rdflib/skiptests.list b/testbed/RDFLib__rdflib/skiptests.list
new file mode 100644
index 0000000000000000000000000000000000000000..7103aff23046a39100dc036a67ea7d76ce54b0ab
--- /dev/null
+++ b/testbed/RDFLib__rdflib/skiptests.list
@@ -0,0 +1,59 @@
+http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest#date-2 xsd:date not supported
+http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest#date-3 xsd:date not supported
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/delete/manifest#dawg-delete-using-02a known issue with update and datasets
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/delete/manifest#dawg-delete-using-06a known issue with update and datasets
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service1 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service2 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service3 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service4a service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service6 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service7 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdf01 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdf02 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs01 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs02 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs03 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs04 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs05 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs06 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs07 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs08 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs09 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs10 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs11 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#rdfs12 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q1 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q1-rdfs entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q2 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#paper-sparqldl-Q3 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-02 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-03 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-06 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-07 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-08 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-10 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-12 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#sparqldl-13 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent3 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent4 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent5 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent6 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent7 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent9 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#parent10 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple1 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple2 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple3 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple4 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple5 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple6 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple7 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/entailment/manifest#simple8 entailment not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service1 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service2 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service3 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service4a service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service6 service not implemented
+http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service7 service not implemented
diff --git a/testbed/RDFLib__rdflib/test/test_parser.py b/testbed/RDFLib__rdflib/test/test_parser.py
new file mode 100644
index 0000000000000000000000000000000000000000..d311a89b0dd9c9c02017e6c899e1a92d84be63bc
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_parser.py
@@ -0,0 +1,44 @@
+import unittest
+
+from rdflib.namespace import RDF, RDFS
+from rdflib.term import URIRef
+from rdflib.term import Literal
+from rdflib.graph import Graph
+
+
+class ParserTestCase(unittest.TestCase):
+ backend = 'default'
+ path = 'store'
+
+ def setUp(self):
+ self.graph = Graph(store=self.backend)
+ self.graph.open(self.path)
+
+ def tearDown(self):
+ self.graph.close()
+
+ def testNoPathWithHash(self):
+ g = self.graph
+ g.parse(data="""\
+
+
+
+
+ testing
+
+
+
+""", publicID="http://example.org")
+
+ subject = URIRef("http://example.org#")
+ label = g.value(subject, RDFS.label)
+ self.assertEqual(label, Literal("testing"))
+ type = g.value(subject, RDF.type)
+ self.assertEqual(type, RDFS.Class)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_parser_structure.py b/testbed/RDFLib__rdflib/test/test_parser_structure.py
new file mode 100644
index 0000000000000000000000000000000000000000..d759061fd358c0475668c79040fb59e966d1de55
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_parser_structure.py
@@ -0,0 +1,13 @@
+import rdflib.plugins.sparql.parser
+import pprint
+
+
+def t(q):
+ print(q)
+ pprint.pprint(rdflib.plugins.sparql.parser.parseQuery(q))
+
+
+t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 . ?s2 ?p ?o .} ")
+
+
+t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 ; ?p3 [ ?p ?o ] . ?s2 ?p ?o .} ")
diff --git a/testbed/RDFLib__rdflib/test/test_prefixTypes.py b/testbed/RDFLib__rdflib/test/test_prefixTypes.py
new file mode 100644
index 0000000000000000000000000000000000000000..415f04590d569c9c1fca712031d2fb3abe5f2c2c
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_prefixTypes.py
@@ -0,0 +1,34 @@
+import unittest
+
+
+from rdflib import Graph
+from six import b
+
+graph = Graph().parse(format='n3', data="""
+@prefix dct: .
+@prefix foaf: .
+@prefix xsd: .
+
+ a foaf:Document;
+ dct:created "2011-03-20"^^xsd:date .
+""")
+
+
+class PrefixTypesTest(unittest.TestCase):
+
+ """N3/Turtle serializers should use prefixes,
+ also for types and datatypes
+
+ This is issue 161
+ http://code.google.com/p/rdflib/issues/detail?id=161
+ """
+
+ def test(self):
+ s = graph.serialize(format='n3')
+ print(s)
+ self.assertTrue(b("foaf:Document") in s)
+ self.assertTrue(b("xsd:date") in s)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_prettyxml.py b/testbed/RDFLib__rdflib/test/test_prettyxml.py
new file mode 100644
index 0000000000000000000000000000000000000000..996e6e54e1f8dc0545aa71e6f24a2244fdb9c985
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_prettyxml.py
@@ -0,0 +1,172 @@
+# -*- coding: UTF-8 -*-
+from rdflib.term import URIRef, BNode, Literal
+from rdflib.namespace import RDF, RDFS
+from six import b, BytesIO
+
+from rdflib.plugins.serializers.rdfxml import PrettyXMLSerializer
+
+from rdflib.graph import ConjunctiveGraph
+
+
+class SerializerTestBase(object):
+
+ repeats = 8
+
+ def setup(self):
+ graph = ConjunctiveGraph()
+ graph.parse(data=self.testContent, format=self.testContentFormat)
+ self.sourceGraph = graph
+
+ def test_serialize_and_reparse(self):
+ reparsedGraph = serialize_and_load(self.sourceGraph, self.serializer)
+ _assert_equal_graphs(self.sourceGraph, reparsedGraph)
+
+ def test_multiple(self):
+ """Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering."""
+ for i in range(self.repeats):
+ self.test_serialize_and_reparse()
+
+ # test_multiple.slowtest=True # not really slow?
+
+
+def _assert_equal_graphs(g1, g2):
+ assert len(g1) == len(g2), "Serialized graph not same size as source graph."
+ g1copy = _mangled_copy(g1)
+ g2copy = _mangled_copy(g2)
+ g1copy -= _mangled_copy(g2)
+ g2copy -= _mangled_copy(g1)
+ assert len(g1copy) == 0, "Source graph larger than serialized graph."
+ assert len(g2copy) == 0, "Serialized graph larger than source graph."
+
+
+_blank = BNode()
+
+
+def _mangled_copy(g):
+ "Makes a copy of the graph, replacing all bnodes with the bnode ``_blank``."
+ gcopy = ConjunctiveGraph()
+
+ def isbnode(v): return isinstance(v, BNode)
+ for s, p, o in g:
+ if isbnode(s):
+ s = _blank
+ if isbnode(p):
+ p = _blank
+ if isbnode(o):
+ o = _blank
+ gcopy.add((s, p, o))
+ return gcopy
+
+
+def serialize(sourceGraph, makeSerializer, getValue=True, extra_args={}):
+ serializer = makeSerializer(sourceGraph)
+ stream = BytesIO()
+ serializer.serialize(stream, **extra_args)
+ return getValue and stream.getvalue() or stream
+
+
+def serialize_and_load(sourceGraph, makeSerializer):
+ stream = serialize(sourceGraph, makeSerializer, False)
+ stream.seek(0)
+ reparsedGraph = ConjunctiveGraph()
+ reparsedGraph.load(stream)
+ return reparsedGraph
+
+
+class TestPrettyXmlSerializer(SerializerTestBase):
+
+ serializer = PrettyXMLSerializer
+
+ testContent = """
+ @prefix rdfs: .
+ @prefix owl: .
+ @prefix : .
+
+ :value rdfs:domain :Test .
+
+ :Test rdfs:subClassOf
+ [ a owl:Restriction;
+ owl:onProperty :value ],
+ [ a owl:Restriction;
+ owl:onProperty :name ] .
+
+ a :Test;
+ rdfs:seeAlso ;
+ :value "A" .
+
+
+ :name "Bee"@en, "Be"@sv;
+ :value "B" .
+
+ a rdfs:Resource;
+ rdfs:seeAlso ;
+ :value 3 .
+
+ a rdfs:Resource;
+ rdfs:seeAlso ;
+ rdfs:seeAlso ;
+ rdfs:seeAlso .
+
+ _:bnode1 a :BNode;
+ rdfs:seeAlso _:bnode2 .
+
+ _:bnode2 a :BNode ;
+ rdfs:seeAlso _:bnode3 .
+
+ _:bnode3 a :BNode ;
+ rdfs:seeAlso _:bnode2 .
+
+ """
+ testContentFormat = 'n3'
+
+ def test_result_fragments(self):
+ rdfXml = serialize(self.sourceGraph, self.serializer)
+ assert b('') in rdfXml
+ assert b('') in rdfXml
+ assert b('Bee') in rdfXml
+ assert b('3') in rdfXml
+ assert b('' in rdfXml, onlyBNodesMsg
+ #assert not '') in rdfXml
+ assert b('') in rdfXml
+ assert b('3') in rdfXml
+ assert b('See also Å
''', datatype=RDF.XMLLiteral)))
+ # when:
+ xmlrepr = g.serialize(format='pretty-xml')
+ # then:
+ assert u'''See also Å
'''.encode('utf-8') in xmlrepr
+
+ def test_pretty_broken_xmlliteral(self):
+ # given:
+ g = ConjunctiveGraph()
+ g.add((BNode(), RDF.value, Literal(u'''<p '''.encode('utf-8') in xmlrepr
+
+
+def _assert_expected_object_types_for_predicates(graph, predicates, types):
+ for s, p, o in graph:
+ if p in predicates:
+ someTrue = [isinstance(o, t) for t in types]
+ assert True in someTrue, \
+ "Bad type %s for object when predicate is <%s>." % (type(o), p)
diff --git a/testbed/RDFLib__rdflib/test/test_rdfxml.py b/testbed/RDFLib__rdflib/test/test_rdfxml.py
new file mode 100644
index 0000000000000000000000000000000000000000..94275e72a8027c2253744610727e9d9da9cbf507
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_rdfxml.py
@@ -0,0 +1,266 @@
+from __future__ import print_function
+
+import sys
+from encodings.utf_8 import StreamWriter
+
+import unittest
+
+import os
+import os.path
+
+from six.moves.urllib.request import url2pathname, urlopen
+
+from rdflib import RDF, RDFS, URIRef, BNode, Literal, Namespace, Graph
+from rdflib.exceptions import ParserError
+from rdflib.util import first
+
+
+import logging
+
+_logger = logging.getLogger("parser_rdfcore")
+
+verbose = 0
+
+
+sw = StreamWriter(sys.stdout)
+
+
+def write(msg):
+ _logger.info(msg + "\n")
+ # sw.write(msg+"\n")
+
+
+class TestStore(Graph):
+ __test__ = False
+
+ def __init__(self, expected):
+ super(TestStore, self).__init__()
+ self.expected = expected
+
+ def add(self, spo):
+ (s, p, o) = spo
+ if not isinstance(s, BNode) and not isinstance(o, BNode):
+ if not (s, p, o) in self.expected:
+ m = "Triple not in expected result: %s, %s, %s" % (
+ s.n3(), p.n3(), o.n3())
+ if verbose:
+ write(m)
+ # raise Exception(m)
+ super(TestStore, self).add((s, p, o))
+
+
+TEST = Namespace("http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#")
+
+CACHE_DIR = os.path.join(os.path.dirname(__file__), "rdf")
+
+skipped = (
+ # "datatypes/Manifest.rdf#test002",
+ # "rdf-containers-syntax-vs-schema/Manifest.rdf#test004",
+ # "rdfms-xml-literal-namespaces/Manifest.rdf#test001",
+ # "rdfms-xml-literal-namespaces/Manifest.rdf#test002",
+ # "rdfms-xmllang/Manifest.rdf#test001",
+ # "rdfms-xmllang/Manifest.rdf#test002",
+ # "xml-canon/Manifest.rdf#test001"
+)
+
+
+def cached_file(url):
+ fname = url2pathname(relative(url))
+
+ fpath = os.path.join(CACHE_DIR, fname)
+ if not os.path.exists(fpath):
+ print("%s does not exist, fetching from %s" % (fpath, url))
+ folder = os.path.dirname(fpath)
+ if not os.path.exists(folder):
+ os.makedirs(folder)
+ f = open(fpath, 'w')
+ try:
+ f.write(urlopen(url).read())
+ finally:
+ f.close()
+ return fpath
+
+
+RDFCOREBASE = "http://www.w3.org/2000/10/rdf-tests/rdfcore/"
+
+
+def relative(url):
+ return url[len(RDFCOREBASE):]
+
+
+def resolve(rel):
+ return RDFCOREBASE + rel
+
+
+def _testPositive(uri, manifest):
+ if verbose:
+ write(u"TESTING: %s" % uri)
+ result = 0 # 1=failed, 0=passed
+ inDoc = first(manifest.objects(uri, TEST["inputDocument"]))
+ outDoc = first(manifest.objects(uri, TEST["outputDocument"]))
+ expected = Graph()
+ if outDoc[-3:] == ".nt":
+ format = "nt"
+ else:
+ format = "xml"
+ expected.parse(cached_file(outDoc), publicID=outDoc, format=format)
+ store = TestStore(expected)
+ if inDoc[-3:] == ".nt":
+ format = "nt"
+ else:
+ format = "xml"
+
+ try:
+ store.parse(cached_file(inDoc), publicID=inDoc, format=format)
+ except ParserError as pe:
+ write("Failed '")
+ write(inDoc)
+ write("' failed with")
+ raise pe
+ try:
+ write(type(pe))
+ except:
+ write("sorry could not dump out error.")
+ result = 1
+ else:
+ if not store.isomorphic(expected):
+ write(u"""Failed: '%s'""" % uri)
+ if verbose:
+ write(""" In:\n""")
+ for s, p, o in store:
+ write("%s %s %s." % (repr(s), repr(p), repr(o)))
+ write(""" Out:\n""")
+ for s, p, o in expected:
+ write("%s %s %s." % (repr(s), repr(p), repr(o)))
+ result += 1
+ return result
+
+
+def _testNegative(uri, manifest):
+ if verbose:
+ write(u"TESTING: %s" % uri)
+ result = 0 # 1=failed, 0=passed
+ inDoc = first(manifest.objects(uri, TEST["inputDocument"]))
+ store = Graph()
+
+ test = BNode()
+ results.add((test, RESULT["test"], uri))
+ results.add((test, RESULT["system"], system))
+
+ try:
+ if inDoc[-3:] == ".nt":
+ format = "nt"
+ else:
+ format = "xml"
+ store.parse(cached_file(inDoc), publicID=inDoc, format=format)
+ except ParserError:
+ results.add((test, RDF.type, RESULT["PassingRun"]))
+ # pass
+ else:
+ write(u"""Failed: '%s'""" % uri)
+ results.add((test, RDF.type, RESULT["FailingRun"]))
+ result = 1
+ return result
+
+
+class ParserTestCase(unittest.TestCase):
+ store = 'default'
+ path = 'store'
+ slow = True
+
+ def setUp(self):
+ self.manifest = manifest = Graph(store=self.store)
+ manifest.open(self.path)
+ manifest.load(cached_file(
+ "http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf"))
+
+ def tearDown(self):
+ self.manifest.close()
+
+ def testNegative(self):
+ manifest = self.manifest
+ num_failed = total = 0
+ negs = list(manifest.subjects(RDF.type, TEST["NegativeParserTest"]))
+ negs.sort()
+ for neg in negs:
+ status = first(manifest.objects(neg, TEST["status"]))
+ if status == Literal("APPROVED"):
+ result = _testNegative(neg, manifest)
+ total += 1
+ num_failed += result
+ self.assertEqual(
+ num_failed, 0, "Failed: %s of %s." % (num_failed, total))
+
+ def testPositive(self):
+ manifest = self.manifest
+ uris = list(manifest.subjects(RDF.type, TEST["PositiveParserTest"]))
+ uris.sort()
+ num_failed = total = 0
+ for uri in uris:
+ status = first(manifest.objects(uri, TEST["status"]))
+ # Failing tests, skipped
+ if uri[44:] in skipped:
+ status = Literal("Locally DISAPPROVED")
+ write("Skipping %s" % uri)
+ if status == Literal("APPROVED"):
+ result = _testPositive(uri, manifest)
+ test = BNode()
+ results.add((test, RESULT["test"], uri))
+ results.add((test, RESULT["system"], system))
+ if not result:
+ results.add((test, RDF.type, RESULT["PassingRun"]))
+ else:
+ results.add((test, RDF.type, RESULT["FailingRun"]))
+ total += 1
+ num_failed += result
+ self.assertEqual(
+ num_failed, 0, "Failed: %s of %s." % (num_failed, total))
+
+
+RESULT = Namespace("http://www.w3.org/2002/03owlt/resultsOntology#")
+FOAF = Namespace("http://xmlns.com/foaf/0.1/")
+
+
+results = Graph()
+
+system = BNode("system")
+results.add((system, FOAF["homepage"], URIRef("http://rdflib.net/")))
+results.add((system, RDFS.label, Literal("RDFLib")))
+results.add((system, RDFS.comment, Literal("")))
+
+
+if __name__ == "__main__":
+ manifest = Graph()
+ manifest.load(cached_file(
+ "http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf"))
+ import sys
+ import getopt
+ try:
+ optlist, args = getopt.getopt(sys.argv[1:], 'h:', ["help"])
+ except getopt.GetoptError as msg:
+ write(msg)
+ # usage()
+
+ try:
+ argv = sys.argv
+ if len(argv) > 1:
+ _logger.setLevel(logging.INFO)
+ _logger.addHandler(logging.StreamHandler())
+
+ for arg in argv[1:]:
+ verbose = 1
+ case = URIRef(arg)
+ write(u"Testing: %s" % case)
+ if (case, RDF.type, TEST["PositiveParserTest"]) in manifest:
+ result = _testPositive(case, manifest)
+ write(u"Positive test %s" % ["PASSED", "FAILED"][result])
+ elif (case, RDF.type, TEST["NegativeParserTest"]) in manifest:
+ result = _testNegative(case, manifest)
+ write(u"Negative test %s" % ["PASSED", "FAILED"][result])
+ else:
+ write(u"%s not ??" % case)
+
+ if len(argv) <= 1:
+ unittest.main()
+ finally:
+ results.serialize("results.rdf")
diff --git a/testbed/RDFLib__rdflib/test/test_roundtrip.py b/testbed/RDFLib__rdflib/test/test_roundtrip.py
new file mode 100644
index 0000000000000000000000000000000000000000..819c944a9d50828fbdbb3073300da3589f808ef8
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_roundtrip.py
@@ -0,0 +1,101 @@
+import sys
+import rdflib
+import rdflib.compare
+
+try:
+ from .test_nt_suite import all_nt_files
+ assert all_nt_files
+except:
+ from test.test_nt_suite import all_nt_files
+
+"""
+Test round-tripping by all serializers/parser that are registerd.
+This means, you may test more than just core rdflib!
+
+run with no arguments to test all formats + all files
+run with a single argument, to test only that format, i.e. "n3"
+run with three arguments to test round-tripping in a given format
+and reading a single file in the given format, i.e.:
+
+python test/test_roundtrip.py xml nt test/nt/literals-02.nt
+
+tests roundtripping through rdf/xml with only the literals-02 file
+
+"""
+
+
+SKIP = [
+ ('xml', 'test/nt/qname-02.nt'), # uses a property that cannot be qname'd
+ # uses a property that cannot be qname'd
+ ('application/rdf+xml', 'test/nt/qname-02.nt'),
+]
+
+
+def roundtrip(e, verbose=False):
+ infmt, testfmt, source = e
+
+ g1 = rdflib.ConjunctiveGraph()
+
+ g1.parse(source, format=infmt)
+
+ s = g1.serialize(format=testfmt)
+
+ if verbose:
+ print("S:")
+ print(s)
+
+ g2 = rdflib.ConjunctiveGraph()
+ g2.parse(data=s, format=testfmt)
+
+ if verbose:
+ both, first, second = rdflib.compare.graph_diff(g1, g2)
+ print("Diff:")
+ print("%d triples in both" % len(both))
+ print("G1 Only:")
+ for t in first:
+ print(t)
+
+ print("--------------------")
+ print("G2 Only")
+ for t in second:
+ print(t)
+
+ assert rdflib.compare.isomorphic(g1, g2)
+
+ if verbose:
+ print("Ok!")
+
+
+formats = None
+
+
+def test_cases():
+ global formats
+ if not formats:
+ serializers = set(
+ x.name for x in rdflib.plugin.plugins(
+ None, rdflib.plugin.Serializer))
+ parsers = set(
+ x.name for x in rdflib.plugin.plugins(
+ None, rdflib.plugin.Parser))
+ formats = parsers.intersection(serializers)
+
+ for testfmt in formats:
+ if "/" in testfmt:
+ continue # skip double testing
+ for f, infmt in all_nt_files():
+ if (testfmt, f) not in SKIP:
+ yield roundtrip, (infmt, testfmt, f)
+
+
+if __name__ == "__main__":
+ import nose
+ if len(sys.argv) == 1:
+ nose.main(defaultTest=sys.argv[0])
+ elif len(sys.argv) == 2:
+ import test.test_roundtrip
+ test.test_roundtrip.formats = [sys.argv[1]]
+ nose.main(defaultTest=sys.argv[0], argv=sys.argv[:1])
+ else:
+ roundtrip(
+ (sys.argv[2], sys.argv[1], sys.argv[3]), verbose=True)
diff --git a/testbed/RDFLib__rdflib/test/test_serializexml.py b/testbed/RDFLib__rdflib/test/test_serializexml.py
new file mode 100644
index 0000000000000000000000000000000000000000..0dfa5e69d1f6f181997784f0b9287c2668ca2eaf
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_serializexml.py
@@ -0,0 +1,158 @@
+from rdflib.term import URIRef, BNode
+from rdflib.namespace import RDFS
+from six import b, BytesIO
+
+from rdflib.plugins.serializers.rdfxml import XMLSerializer
+
+from rdflib.graph import ConjunctiveGraph
+
+
+class SerializerTestBase(object):
+
+ repeats = 8
+
+ def setup(self):
+ graph = ConjunctiveGraph()
+ graph.parse(data=self.testContent, format=self.testContentFormat)
+ self.sourceGraph = graph
+
+ def test_serialize_and_reparse(self):
+ reparsedGraph = serialize_and_load(self.sourceGraph, self.serializer)
+ _assert_equal_graphs(self.sourceGraph, reparsedGraph)
+
+ def test_multiple(self):
+ """Repeats ``test_serialize`` ``self.repeats`` times, to reduce sucess based on in-memory ordering."""
+ for i in range(self.repeats):
+ self.test_serialize_and_reparse()
+
+ # test_multiple.slowtest=True # not really slow?
+
+
+def _assert_equal_graphs(g1, g2):
+ assert len(g1) == len(g2), "Serialized graph not same size as source graph."
+ g1copy = _mangled_copy(g1)
+ g2copy = _mangled_copy(g2)
+ g1copy -= _mangled_copy(g2)
+ g2copy -= _mangled_copy(g1)
+ assert len(g1copy) == 0, "Source graph larger than serialized graph."
+ assert len(g2copy) == 0, "Serialized graph larger than source graph."
+
+
+_blank = BNode()
+
+
+def _mangled_copy(g):
+ "Makes a copy of the graph, replacing all bnodes with the bnode ``_blank``."
+ gcopy = ConjunctiveGraph()
+
+ def isbnode(v): return isinstance(v, BNode)
+ for s, p, o in g:
+ if isbnode(s):
+ s = _blank
+ if isbnode(p):
+ p = _blank
+ if isbnode(o):
+ o = _blank
+ gcopy.add((s, p, o))
+ return gcopy
+
+
+def serialize(sourceGraph, makeSerializer, getValue=True, extra_args={}):
+ serializer = makeSerializer(sourceGraph)
+ stream = BytesIO()
+ serializer.serialize(stream, **extra_args)
+ return getValue and stream.getvalue() or stream
+
+
+def serialize_and_load(sourceGraph, makeSerializer):
+ stream = serialize(sourceGraph, makeSerializer, False)
+ stream.seek(0)
+ reparsedGraph = ConjunctiveGraph()
+ reparsedGraph.load(stream)
+ return reparsedGraph
+
+
+class TestXMLSerializer(SerializerTestBase):
+
+ serializer = XMLSerializer
+
+ testContent = """
+ @prefix rdfs: .
+ @prefix owl: .
+ @prefix : .
+
+ :value rdfs:domain :Test .
+
+ :Test rdfs:subClassOf
+ [ a owl:Restriction;
+ owl:onProperty :value ],
+ [ a owl:Restriction;
+ owl:onProperty :name ] .
+
+ a :Test;
+ rdfs:seeAlso ;
+ :value "A" .
+
+
+ :name "Bee"@en, "Be"@sv;
+ :value "B" .
+
+ a rdfs:Resource;
+ rdfs:seeAlso ;
+ :value 3 .
+
+ a rdfs:Resource;
+ rdfs:seeAlso ;
+ rdfs:seeAlso ;
+ rdfs:seeAlso .
+
+ _:bnode1 a :BNode;
+ rdfs:seeAlso _:bnode2 .
+
+ _:bnode2 a :BNode ;
+ rdfs:seeAlso _:bnode3 .
+
+ _:bnode3 a :BNode ;
+ rdfs:seeAlso _:bnode2 .
+
+ """
+ testContentFormat = 'n3'
+
+ def test_result_fragments(self):
+ rdfXml = serialize(self.sourceGraph, self.serializer)
+ # print "--------"
+ # print rdfXml
+ # print "--------"
+ assert b('') in rdfXml
+ assert b('') in rdfXml
+ assert b('') in rdfXml
+ assert b('Bee') in rdfXml
+ assert b('3') in rdfXml
+ assert b('') in rdfXml
+ assert b('') in rdfXml
+ assert b('') in rdfXml
+ assert b('3') in rdfXml
+ assert b('." % (type(o), p)
diff --git a/testbed/RDFLib__rdflib/test/test_slice.py b/testbed/RDFLib__rdflib/test/test_slice.py
new file mode 100644
index 0000000000000000000000000000000000000000..27e6e49a3789910391310d699839ce32b239d166
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_slice.py
@@ -0,0 +1,81 @@
+
+from rdflib import Graph, URIRef
+import unittest
+
+
+class GraphSlice(unittest.TestCase):
+
+ def testSlice(self):
+ """
+ We pervert the slice object,
+ and use start, stop, step as subject, predicate, object
+
+ all operations return generators over full triples
+ """
+
+ def sl(x, y): return self.assertEqual(len(list(x)), y)
+
+ def soe(x, y): return self.assertEqual(
+ set([a[2] for a in x]), set(y)) # equals objects
+ g = self.graph
+
+ # Single terms are all trivial:
+
+ # single index slices by subject, i.e. return triples((x,None,None))
+ # tell me everything about "tarek"
+ sl(g[self.tarek], 2)
+
+ # single slice slices by s,p,o, with : used to split
+ # tell me everything about "tarek" (same as above)
+ sl(g[self.tarek::], 2)
+
+ # give me every "likes" relationship
+ sl(g[:self.likes:], 5)
+
+ # give me every relationship to pizza
+ sl(g[::self.pizza], 3)
+
+ # give me everyone who likes pizza
+ sl(g[:self.likes:self.pizza], 2)
+
+ # does tarek like pizza?
+ self.assertTrue(g[self.tarek:self.likes:self.pizza])
+
+ # More intesting is using paths
+
+ # everything hated or liked
+ sl(g[:self.hates | self.likes], 7)
+
+ def setUp(self):
+ self.graph = Graph()
+
+ self.michel = URIRef(u'michel')
+ self.tarek = URIRef(u'tarek')
+ self.bob = URIRef(u'bob')
+ self.likes = URIRef(u'likes')
+ self.hates = URIRef(u'hates')
+ self.pizza = URIRef(u'pizza')
+ self.cheese = URIRef(u'cheese')
+
+ self.addStuff()
+
+ def addStuff(self):
+ tarek = self.tarek
+ michel = self.michel
+ bob = self.bob
+ likes = self.likes
+ hates = self.hates
+ pizza = self.pizza
+ cheese = self.cheese
+
+ self.graph.add((tarek, likes, pizza))
+ self.graph.add((tarek, likes, cheese))
+ self.graph.add((michel, likes, pizza))
+ self.graph.add((michel, likes, cheese))
+ self.graph.add((bob, likes, cheese))
+ self.graph.add((bob, hates, pizza))
+ self.graph.add((bob, hates, michel)) # gasp!
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_sparql.py b/testbed/RDFLib__rdflib/test/test_sparql.py
new file mode 100644
index 0000000000000000000000000000000000000000..c3f289fc010f73d2c7d2961e013ac7ccc1274918
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_sparql.py
@@ -0,0 +1,113 @@
+from rdflib import Graph, URIRef, Literal, BNode
+from rdflib.plugins.sparql import prepareQuery
+from rdflib.compare import isomorphic
+
+from nose.tools import eq_
+
+
+def test_graph_prefix():
+ """
+ This is issue https://github.com/RDFLib/rdflib/issues/313
+ """
+
+ g1 = Graph()
+ g1.parse(data="""
+ @prefix : .
+ :foo 42.
+ """, format="n3")
+
+ g2 = Graph()
+ g2.parse(data="""
+ @prefix : .
+ 42.
+ """, format="n3")
+
+ assert isomorphic(g1, g2)
+
+ q_str = ("""
+ PREFIX :
+ SELECT ?val
+ WHERE { :foo ?p ?val }
+ """)
+ q_prepared = prepareQuery(q_str)
+
+ expected = [(Literal(42),)]
+
+ eq_(list(g1.query(q_prepared)), expected)
+ eq_(list(g2.query(q_prepared)), expected)
+
+ eq_(list(g1.query(q_str)), expected)
+ eq_(list(g2.query(q_str)), expected)
+
+
+def test_variable_order():
+
+ g = Graph()
+ g.add((URIRef("http://foo"), URIRef("http://bar"), URIRef("http://baz")))
+ res = g.query("SELECT (42 AS ?a) ?b { ?b ?c ?d }")
+
+ row = list(res)[0]
+ print(row)
+ assert len(row) == 2
+ assert row[0] == Literal(42)
+ assert row[1] == URIRef("http://foo")
+
+
+def test_sparql_bnodelist():
+ """
+
+ syntax tests for a few corner-cases not touched by the
+ official tests.
+
+ """
+
+ prepareQuery('select * where { ?s ?p ( [] ) . }')
+ prepareQuery('select * where { ?s ?p ( [ ?p2 ?o2 ] ) . }')
+ prepareQuery('select * where { ?s ?p ( [ ?p2 ?o2 ] [] ) . }')
+ prepareQuery('select * where { ?s ?p ( [] [ ?p2 ?o2 ] [] ) . }')
+
+
+def test_complex_sparql_construct():
+
+ g = Graph()
+ q = '''select ?subject ?study ?id where {
+ ?s a ;
+ ?c;
+ ?mother, ?father;
+ [ a ; ?id].
+ }'''
+ g.query(q)
+
+
+def test_sparql_update_with_bnode():
+ """
+ Test if the blank node is inserted correctly.
+ """
+ graph = Graph()
+ graph.update(
+ "INSERT DATA { _:blankA }")
+ for t in graph.triples((None, None, None)):
+ assert isinstance(t[0], BNode)
+ eq_(t[1].n3(), "")
+ eq_(t[2].n3(), "")
+
+
+def test_sparql_update_with_bnode_serialize_parse():
+ """
+ Test if the blank node is inserted correctly, can be serialized and parsed.
+ """
+ graph = Graph()
+ graph.update(
+ "INSERT DATA { _:blankA }")
+ string = graph.serialize(format='ntriples').decode('utf-8')
+ raised = False
+ try:
+ Graph().parse(data=string, format="ntriples")
+ except Exception as e:
+ raised = True
+ assert not raised
+
+
+if __name__ == '__main__':
+ import nose
+ nose.main(defaultTest=__name__)
diff --git a/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py b/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ab0f58af01abe2f69023ad04a4e01444353924f
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_sparql_agg_distinct.py
@@ -0,0 +1,108 @@
+from rdflib import Graph
+
+query_tpl = '''
+SELECT ?x (MIN(?y_) as ?y) (%s(DISTINCT ?z_) as ?z) {
+ VALUES (?x ?y_ ?z_) {
+ ("x1" 10 1)
+ ("x1" 11 1)
+ ("x2" 20 2)
+ }
+} GROUP BY ?x ORDER BY ?x
+'''
+
+
+def test_group_concat_distinct():
+ g = Graph()
+ results = g.query(query_tpl % 'GROUP_CONCAT')
+ results = [[lit.toPython() for lit in line] for line in results]
+
+ # this is the tricky part
+ assert results[0][2] == "1", results[0][2]
+
+ # still check the whole result, to be on the safe side
+ assert results == [
+ ["x1", 10, "1"],
+ ["x2", 20, "2"],
+ ], results
+
+
+def test_sum_distinct():
+ g = Graph()
+ results = g.query(query_tpl % 'SUM')
+ results = [[lit.toPython() for lit in line] for line in results]
+
+ # this is the tricky part
+ assert results[0][2] == 1, results[0][2]
+
+ # still check the whole result, to be on the safe side
+ assert results == [
+ ["x1", 10, 1],
+ ["x2", 20, 2],
+ ], results
+
+
+def test_avg_distinct():
+ g = Graph()
+ results = g.query("""
+ SELECT ?x (MIN(?y_) as ?y) (AVG(DISTINCT ?z_) as ?z) {
+ VALUES (?x ?y_ ?z_) {
+ ("x1" 10 1)
+ ("x1" 11 1)
+ ("x1" 12 3)
+ ("x2" 20 2)
+ }
+ } GROUP BY ?x ORDER BY ?x
+ """)
+ results = [[lit.toPython() for lit in line] for line in results]
+
+ # this is the tricky part
+ assert results[0][2] == 2, results[0][2]
+
+ # still check the whole result, to be on the safe side
+ assert results == [
+ ["x1", 10, 2],
+ ["x2", 20, 2],
+ ], results
+
+
+def test_count_distinct():
+ g = Graph()
+
+ g.parse(format="turtle", publicID="http://example.org/", data="""
+ @prefix : <> .
+
+ <#a>
+ :knows <#b>, <#c> ;
+ :age 42 .
+
+ <#b>
+ :knows <#a>, <#c> ;
+ :age 36 .
+
+ <#c>
+ :knows <#b>, <#c> ;
+ :age 20 .
+
+ """)
+
+ # Query 1: people knowing someone younger
+ results = g.query("""
+ PREFIX :
+
+ SELECT DISTINCT ?x {
+ ?x :age ?ax ; :knows [ :age ?ay ].
+ FILTER( ?ax > ?ay )
+ }
+ """)
+ assert len(results) == 2
+
+ # nQuery 2: count people knowing someone younger
+ results = g.query("""
+ PREFIX :
+
+ SELECT (COUNT(DISTINCT ?x) as ?cx) {
+ ?x :age ?ax ; :knows [ :age ?ay ].
+ FILTER( ?ax > ?ay )
+ }
+ """)
+ assert list(results)[0][0].toPython() == 2
diff --git a/testbed/RDFLib__rdflib/test/test_sparqlstore.py b/testbed/RDFLib__rdflib/test/test_sparqlstore.py
new file mode 100644
index 0000000000000000000000000000000000000000..26a694603b5ea419a13aa29fd26b2d74dca1245d
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_sparqlstore.py
@@ -0,0 +1,71 @@
+from rdflib import Graph, URIRef, Literal
+from six.moves.urllib.request import urlopen
+import os
+import unittest
+from nose import SkipTest
+from requests import HTTPError
+
+
+try:
+ assert len(urlopen("http://dbpedia.org/sparql").read()) > 0
+except:
+ raise SkipTest("No HTTP connection.")
+
+
+class SPARQLStoreDBPediaTestCase(unittest.TestCase):
+ store_name = 'SPARQLStore'
+ path = "http://dbpedia.org/sparql"
+ storetest = True
+ create = False
+
+ def setUp(self):
+ self.graph = Graph(store="SPARQLStore")
+ self.graph.open(self.path, create=self.create)
+ ns = list(self.graph.namespaces())
+ assert len(ns) > 0, ns
+
+ def tearDown(self):
+ self.graph.close()
+
+ def test_Query(self):
+ query = "select distinct ?Concept where {[] a ?Concept} LIMIT 1"
+ res = self.graph.query(query, initNs={})
+ for i in res:
+ assert type(i[0]) == URIRef, i[0].n3()
+
+ def test_initNs(self):
+ query = """\
+ SELECT ?label WHERE
+ { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10
+ """
+ res = self.graph.query(
+ query,
+ initNs={"xyzzy": "http://www.w3.org/2004/02/skos/core#"})
+ for i in res:
+ assert type(i[0]) == Literal, i[0].n3()
+
+ def test_noinitNs(self):
+ query = """\
+ SELECT ?label WHERE
+ { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10
+ """
+ self.assertRaises(
+ HTTPError,
+ self.graph.query,
+ query)
+
+ def test_query_with_added_prolog(self):
+ prologue = """\
+ PREFIX xyzzy:
+ """
+ query = """\
+ SELECT ?label WHERE
+ { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10
+ """
+ res = self.graph.query(prologue + query)
+ for i in res:
+ assert type(i[0]) == Literal, i[0].n3()
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py b/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py
new file mode 100644
index 0000000000000000000000000000000000000000..161ed6a079ea38844546196333957b81fc80b980
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_sparqlupdatestore.py
@@ -0,0 +1,340 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from nose import SkipTest
+
+import unittest
+import re
+
+from rdflib import ConjunctiveGraph, URIRef, Literal, BNode, Graph
+from six import text_type
+from six.moves.urllib.request import urlopen
+
+HOST = 'http://localhost:3031'
+DB = '/db/'
+
+# this assumes SPARQL1.1 query/update endpoints running locally at
+# http://localhost:3031/db/
+#
+# The ConjunctiveGraph tests below require that the SPARQL endpoint renders its
+# default graph as the union of all known graphs! This is incompatible with the
+# endpoint behavior required by our Dataset tests in test_dataset.py, so you
+# need to run a second SPARQL endpoint on a non standard port,
+# e.g. fuseki started with:
+# ./fuseki-server --port 3031 --memTDB --update --set tdb:unionDefaultGraph=true /db
+
+# THIS WILL DELETE ALL DATA IN THE /db dataset
+
+michel = URIRef(u'urn:michel')
+tarek = URIRef(u'urn:tarek')
+bob = URIRef(u'urn:bob')
+likes = URIRef(u'urn:likes')
+hates = URIRef(u'urn:hates')
+pizza = URIRef(u'urn:pizza')
+cheese = URIRef(u'urn:cheese')
+
+graphuri = URIRef('urn:graph')
+othergraphuri = URIRef('urn:othergraph')
+
+
+class TestSparql11(unittest.TestCase):
+
+ def setUp(self):
+ self.longMessage = True
+ self.graph = ConjunctiveGraph('SPARQLUpdateStore')
+
+ root = HOST + DB
+ self.graph.open((root + "sparql", root + "update"))
+
+ # clean out the store
+ for c in self.graph.contexts():
+ c.remove((None, None, None))
+ assert len(c) == 0
+
+ def tearDown(self):
+ self.graph.close()
+
+ def testSimpleGraph(self):
+ g = self.graph.get_context(graphuri)
+ g.add((tarek, likes, pizza))
+ g.add((bob, likes, pizza))
+ g.add((bob, likes, cheese))
+
+ g2 = self.graph.get_context(othergraphuri)
+ g2.add((michel, likes, pizza))
+
+ self.assertEqual(3, len(g), 'graph contains 3 triples')
+ self.assertEqual(1, len(g2), 'other graph contains 1 triple')
+
+ r = g.query("SELECT * WHERE { ?s . }")
+ self.assertEqual(2, len(list(r)), "two people like pizza")
+
+ r = g.triples((None, likes, pizza))
+ self.assertEqual(2, len(list(r)), "two people like pizza")
+
+ # Test initBindings
+ r = g.query("SELECT * WHERE { ?s . }",
+ initBindings={'s': tarek})
+ self.assertEqual(1, len(list(r)), "i was asking only about tarek")
+
+ r = g.triples((tarek, likes, pizza))
+ self.assertEqual(1, len(list(r)), "i was asking only about tarek")
+
+ r = g.triples((tarek, likes, cheese))
+ self.assertEqual(0, len(list(r)), "tarek doesn't like cheese")
+
+ g2.add((tarek, likes, pizza))
+ g.remove((tarek, likes, pizza))
+ r = g.query("SELECT * WHERE { ?s . }")
+ self.assertEqual(1, len(list(r)), "only bob likes pizza")
+
+ def testConjunctiveDefault(self):
+ g = self.graph.get_context(graphuri)
+ g.add((tarek, likes, pizza))
+ g2 = self.graph.get_context(othergraphuri)
+ g2.add((bob, likes, pizza))
+ g.add((tarek, hates, cheese))
+
+ self.assertEqual(2, len(g), 'graph contains 2 triples')
+
+ # the following are actually bad tests as they depend on your endpoint,
+ # as pointed out in the sparqlstore.py code:
+ #
+ # For ConjunctiveGraphs, reading is done from the "default graph" Exactly
+ # what this means depends on your endpoint, because SPARQL does not offer a
+ # simple way to query the union of all graphs as it would be expected for a
+ # ConjuntiveGraph.
+ ##
+ # Fuseki/TDB has a flag for specifying that the default graph
+ # is the union of all graphs (tdb:unionDefaultGraph in the Fuseki config).
+ self.assertEqual(3, len(self.graph),
+ 'default union graph should contain three triples but contains:\n'
+ '%s' % list(self.graph))
+
+ r = self.graph.query("SELECT * WHERE { ?s . }")
+ self.assertEqual(2, len(list(r)), "two people like pizza")
+
+ r = self.graph.query("SELECT * WHERE { ?s . }",
+ initBindings={'s': tarek})
+ self.assertEqual(1, len(list(r)), "i was asking only about tarek")
+
+ r = self.graph.triples((tarek, likes, pizza))
+ self.assertEqual(1, len(list(r)), "i was asking only about tarek")
+
+ r = self.graph.triples((tarek, likes, cheese))
+ self.assertEqual(0, len(list(r)), "tarek doesn't like cheese")
+
+ g2.remove((bob, likes, pizza))
+
+ r = self.graph.query("SELECT * WHERE { ?s . }")
+ self.assertEqual(1, len(list(r)), "only tarek likes pizza")
+
+ def testUpdate(self):
+ self.graph.update("INSERT DATA { GRAPH { . } }")
+
+ g = self.graph.get_context(graphuri)
+ self.assertEqual(1, len(g), 'graph contains 1 triples')
+
+ def testUpdateWithInitNs(self):
+ self.graph.update(
+ "INSERT DATA { GRAPH ns:graph { ns:michel ns:likes ns:pizza . } }",
+ initNs={'ns': URIRef('urn:')}
+ )
+
+ g = self.graph.get_context(graphuri)
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(michel, likes, pizza)]),
+ 'only michel likes pizza'
+ )
+
+ def testUpdateWithInitBindings(self):
+ self.graph.update(
+ "INSERT { GRAPH { ?a ?b ?c . } } WherE { }",
+ initBindings={
+ 'a': URIRef('urn:michel'),
+ 'b': URIRef('urn:likes'),
+ 'c': URIRef('urn:pizza'),
+ }
+ )
+
+ g = self.graph.get_context(graphuri)
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(michel, likes, pizza)]),
+ 'only michel likes pizza'
+ )
+
+ def testUpdateWithBlankNode(self):
+ self.graph.update(
+ "INSERT DATA { GRAPH { _:blankA } }")
+ g = self.graph.get_context(graphuri)
+ for t in g.triples((None, None, None)):
+ self.assertTrue(isinstance(t[0], BNode))
+ self.assertEqual(t[1].n3(), "")
+ self.assertEqual(t[2].n3(), "")
+
+ def testUpdateWithBlankNodeSerializeAndParse(self):
+ self.graph.update(
+ "INSERT DATA { GRAPH { _:blankA } }")
+ g = self.graph.get_context(graphuri)
+ string = g.serialize(format='ntriples').decode('utf-8')
+ raised = False
+ try:
+ Graph().parse(data=string, format="ntriples")
+ except Exception as e:
+ raised = True
+ self.assertFalse(raised, 'Exception raised when parsing: ' + string)
+
+ def testMultipleUpdateWithInitBindings(self):
+ self.graph.update(
+ "INSERT { GRAPH { ?a ?b ?c . } } WHERE { };"
+ "INSERT { GRAPH { ?d ?b ?c . } } WHERE { }",
+ initBindings={
+ 'a': URIRef('urn:michel'),
+ 'b': URIRef('urn:likes'),
+ 'c': URIRef('urn:pizza'),
+ 'd': URIRef('urn:bob'),
+ }
+ )
+
+ g = self.graph.get_context(graphuri)
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(michel, likes, pizza), (bob, likes, pizza)]),
+ 'michel and bob like pizza'
+ )
+
+ def testNamedGraphUpdate(self):
+ g = self.graph.get_context(graphuri)
+ r1 = "INSERT DATA { }"
+ g.update(r1)
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(michel, likes, pizza)]),
+ 'only michel likes pizza'
+ )
+
+ r2 = "DELETE { } " + \
+ "INSERT { } WHERE {}"
+ g.update(r2)
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(bob, likes, pizza)]),
+ 'only bob likes pizza'
+ )
+ says = URIRef("urn:says")
+
+ # Strings with unbalanced curly braces
+ tricky_strs = ["With an unbalanced curly brace %s " % brace
+ for brace in ["{", "}"]]
+ for tricky_str in tricky_strs:
+ r3 = """INSERT { ?b "%s" }
+ WHERE { ?b } """ % tricky_str
+ g.update(r3)
+
+ values = set()
+ for v in g.objects(bob, says):
+ values.add(str(v))
+ self.assertEqual(values, set(tricky_strs))
+
+ # Complicated Strings
+ r4strings = []
+ r4strings.append(r'''"1: adfk { ' \\\" \" { "''')
+ r4strings.append(r'''"2: adfk } #éï \\"''')
+
+ r4strings.append(r"""'3: adfk { " \\\' \' { '""")
+ r4strings.append(r"""'4: adfk } #éï \\'""")
+
+ r4strings.append(r'''"""5: adfk { ' \\\" \" { """''')
+ r4strings.append(r'''"""6: adfk } #éï \\"""''')
+ r4strings.append('"""7: ad adsfj \n { \n sadfj"""')
+
+ r4strings.append(r"""'''8: adfk { " \\\' \' { '''""")
+ r4strings.append(r"""'''9: adfk } #éï \\'''""")
+ r4strings.append("'''10: ad adsfj \n { \n sadfj'''")
+
+ r4 = "\n".join([
+ u'INSERT DATA { %s } ;' % s
+ for s in r4strings
+ ])
+ g.update(r4)
+ values = set()
+ for v in g.objects(michel, says):
+ values.add(text_type(v))
+ self.assertEqual(values, set([re.sub(r"\\(.)", r"\1", re.sub(
+ r"^'''|'''$|^'|'$|" + r'^"""|"""$|^"|"$', r"", s)) for s in r4strings]))
+
+ # IRI Containing ' or #
+ # The fragment identifier must not be misinterpreted as a comment
+ # (commenting out the end of the block).
+ # The ' must not be interpreted as the start of a string, causing the }
+ # in the literal to be identified as the end of the block.
+ r5 = """INSERT DATA { , "'}" }"""
+
+ g.update(r5)
+ values = set()
+ for v in g.objects(michel, hates):
+ values.add(text_type(v))
+ self.assertEqual(values, set([u"urn:foo'bar?baz;a=1&b=2#fragment", u"'}"]))
+
+ # Comments
+ r6 = u"""
+ INSERT DATA {
+ . # No closing brace: }
+ .
+ }
+ #Final { } comment"""
+
+ g.update(r6)
+ values = set()
+ for v in g.objects(bob, hates):
+ values.add(v)
+ self.assertEqual(values, set([bob, michel]))
+
+ def testNamedGraphUpdateWithInitBindings(self):
+ g = self.graph.get_context(graphuri)
+ r = "INSERT { ?a ?b ?c } WHERE {}"
+ g.update(r, initBindings={
+ 'a': michel,
+ 'b': likes,
+ 'c': pizza
+ })
+ self.assertEqual(
+ set(g.triples((None, None, None))),
+ set([(michel, likes, pizza)]),
+ 'only michel likes pizza'
+ )
+
+ def testEmptyNamedGraph(self):
+ empty_graph_iri = "urn:empty-graph-1"
+ self.graph.update("CREATE GRAPH <%s>" % empty_graph_iri)
+ named_graphs = [text_type(r[0]) for r in self.graph.query(
+ "SELECT ?name WHERE { GRAPH ?name {} }")]
+ # Some SPARQL endpoint backends (like TDB) are not able to find empty named graphs
+ # (at least with this query)
+ if empty_graph_iri in named_graphs:
+ self.assertTrue(empty_graph_iri in [text_type(g.identifier)
+ for g in self.graph.contexts()])
+
+ def testEmptyLiteral(self):
+ # test for https://github.com/RDFLib/rdflib/issues/457
+ # also see test_issue457.py which is sparql store independent!
+ g = self.graph.get_context(graphuri)
+ g.add((
+ URIRef('http://example.com/s'),
+ URIRef('http://example.com/p'),
+ Literal('')))
+
+ o = tuple(g)[0][2]
+ self.assertEqual(o, Literal(''), repr(o))
+
+
+try:
+ assert len(urlopen(HOST).read()) > 0
+except:
+ raise SkipTest(HOST + " is unavailable.")
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_swap_n3.py b/testbed/RDFLib__rdflib/test/test_swap_n3.py
new file mode 100644
index 0000000000000000000000000000000000000000..c81378e144d089aabd36506c84976fdc3f16204f
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_swap_n3.py
@@ -0,0 +1,154 @@
+from nose.exc import SkipTest
+import os
+import sys
+import unittest
+try:
+ maketrans = str.maketrans
+except AttributeError:
+ from string import maketrans
+import rdflib
+
+"""
+SWAP N3 parser test suite
+"""
+
+rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
+rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#")
+xsd = rdflib.Namespace("http://www.w3.org/2001/XMLSchema#")
+owl = rdflib.Namespace("http://www.w3.org/2002/07/owl#")
+test = rdflib.Namespace("http://www.w3.org/2000/10/swap/test.n3#")
+n3test = rdflib.Namespace("http://www.w3.org/2004/11/n3test#")
+rdft = rdflib.Namespace("http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#")
+triage = rdflib.Namespace("http://www.w3.org/2000/10/swap/test/triage#")
+mf = rdflib.Namespace("http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#")
+qt = rdflib.Namespace("http://www.w3.org/2001/sw/DataAccess/tests/test-query#")
+
+
+# class TestSWAPN3(unittest.TestCase):
+# """SWAP 2000/10/n3 tests"""
+
+# def setUp(self):
+
+# def test_foo(self):
+# """footest"""
+# self.graph.parse(os.getcwd()+'/test/swap-n3/n3-rdf.tests', format="n3")
+# tfiles = []
+# for tst in self.graph.subjects():
+# files = [str(tfile).replace('http://www.w3.org/2000/10/', 'file://'+os.getcwd()+'/test/swap-n3/')
+# for tfile in self.graph.objects(tst, rdflib.URIRef("http://www.w3.org/2004/11/n3test#inputDocument")) if tfile.endswith('n3')]
+# tfiles += files
+# for tfile in tfiles:
+# self.graph.parse(tfile, format="n3")
+
+
+skiptests = [
+ 'syntax_neg_single_quote',
+ 'syntax_neg_literal_predicate',
+ 'syntax_this_quantifiers',
+ 'syntax_trailing_semicolon',
+ 'syntax_neg_thisadoc',
+ 'syntax_equals1',
+ 'syntax_equals2',
+ 'syntax_this_rules',
+ 'syntax_neg_keywords3',
+ 'syntax_zero_objects',
+ 'syntax_neg_formula_predicate',
+ 'syntax_zero_predicates',
+ # 'syntax_qvars1',
+ # 'syntax_qvars2',
+ # 'contexts',
+ 'syntax_too_nested'
+]
+
+
+class Envelope(object):
+ def __init__(self, n, f):
+ self.name = n
+ self.file = f
+
+ def __repr__(self):
+ return self.name
+
+
+def generictest(e):
+ """Documentation"""
+ if e.skip:
+ raise SkipTest("%s skipped, known issue" % e.name)
+ g = rdflib.Graph()
+ for i in [rdf, rdfs, xsd, owl, test, n3test, rdft, triage, mf, qt]:
+ g.bind(str(i), i)
+ g.parse(e.file, format="n3")
+
+
+def dir_to_uri(directory, sep=os.path.sep):
+ '''
+ Convert a local path to a File URI.
+
+ >>> dir_to_uri('c:\\\\temp\\\\foo\\\\file.txt', sep='\\\\')
+ 'file:///c:/temp/foo/file.txt'
+
+ >>> dir_to_uri('/tmp/foo/file.txt', sep='/')
+ 'file:///tmp/foo/file.txt'
+ '''
+ items = directory.split(sep)
+ path = '/'.join(items)
+ if path.startswith('/'):
+ path = path[1:]
+ return 'file:///%s' % (path,)
+
+
+def test_cases():
+ from copy import deepcopy
+ g = rdflib.Graph()
+ swap_dir = os.path.join(os.getcwd(), 'test', 'swap-n3')
+ g.parse(os.path.join(swap_dir, 'n3-rdf.tests'), format="n3")
+ g.parse(os.path.join(swap_dir, 'n3-full.tests'), format="n3")
+ tfiles = []
+ swap_dir_uri = dir_to_uri(swap_dir) + '/'
+ for tst in g.subjects():
+ files = [str(tfile).replace('http://www.w3.org/2000/10/', swap_dir_uri)
+ for tfile in g.objects(tst, rdflib.URIRef("http://www.w3.org/2004/11/n3test#inputDocument")) if tfile.endswith('n3')]
+ tfiles += files
+ for tfile in set(tfiles):
+ gname = tfile.split('/swap-n3/swap/test/')[1][:-3].translate(maketrans('-/','__'))
+ e = Envelope(gname, tfile)
+ if gname in skiptests:
+ e.skip = True
+ else:
+ e.skip = False
+ # e.skip = True
+ if sys.version_info[:2] == (2, 4):
+ import pickle
+ gjt = pickle.dumps(generictest)
+ gt = pickle.loads(gjt)
+ else:
+ gt = deepcopy(generictest)
+ gt.__doc__ = tfile
+ yield gt, e
+
+
+if __name__ == "__main__":
+ test_cases()
+ # unittest.main()
+
+
+"""
+Interesting failure in Python 2.4 ...
+
+======================================================================
+ERROR: Failure: TypeError (function() takes at least 2 arguments (0 given))
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File ".../python2.4/site-packages/nose/loader.py", line 231, in generate
+ for test in g():
+ File ".../rdflib/test/test_swap_n3.py", line 95, in test_cases
+ gt = deepcopy(generictest)
+ File "/usr/local/python2.4/lib/python2.4/copy.py", line 204, in deepcopy
+ y = _reconstruct(x, rv, 1, memo)
+ File "/usr/local/python2.4/lib/python2.4/copy.py", line 336, in _reconstruct
+ y = callable(*args)
+ File "...py24/lib/python2.4/copy_reg.py", line 92, in __newobj__
+ return cls.__new__(cls, *args)
+TypeError: function() takes at least 2 arguments (0 given)
+
+"""
diff --git a/testbed/RDFLib__rdflib/test/test_term.py b/testbed/RDFLib__rdflib/test/test_term.py
new file mode 100644
index 0000000000000000000000000000000000000000..c222a8d29d070c01184f13c074c632c4b42478d6
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_term.py
@@ -0,0 +1,140 @@
+"""
+some more specific Literal tests are in test_literal.py
+"""
+
+import base64
+import unittest
+import random
+
+from rdflib.term import URIRef, BNode, Literal, _is_valid_unicode
+from rdflib.graph import QuotedGraph, Graph
+from rdflib.namespace import XSD
+
+from six import PY3
+
+
+def uformat(s):
+ if PY3:
+ return s.replace("u'", "'")
+ return s
+
+
+class TestURIRefRepr(unittest.TestCase):
+ """
+ see also test_literal.TestRepr
+ """
+
+ def testSubclassNameAppearsInRepr(self):
+ class MyURIRef(URIRef):
+ pass
+ x = MyURIRef('http://example.com/')
+ self.assertEqual(repr(x), uformat("MyURIRef(u'http://example.com/')"))
+
+ def testGracefulOrdering(self):
+ u = URIRef('cake')
+ g = Graph()
+ a = u > u
+ a = u > BNode()
+ a = u > QuotedGraph(g.store, u)
+ a = u > g
+
+
+class TestBNodeRepr(unittest.TestCase):
+
+ def testSubclassNameAppearsInRepr(self):
+ class MyBNode(BNode):
+ pass
+ x = MyBNode()
+ self.assertTrue(repr(x).startswith("MyBNode("))
+
+
+class TestLiteral(unittest.TestCase):
+
+ def test_base64_values(self):
+ b64msg = 'cmRmbGliIGlzIGNvb2whIGFsc28gaGVyZSdzIHNvbWUgYmluYXJ5IAAR83UC'
+ decoded_b64msg = base64.b64decode(b64msg)
+ lit = Literal(b64msg, datatype=XSD.base64Binary)
+ self.assertEqual(lit.value, decoded_b64msg)
+ self.assertEqual(str(lit), b64msg)
+
+ def test_total_order(self):
+ types = {
+ XSD.dateTime: (
+ '2001-01-01T00:00:00',
+ '2001-01-01T00:00:00Z',
+ '2001-01-01T00:00:00-00:00'
+ ),
+ XSD.date: (
+ '2001-01-01',
+ '2001-01-01Z',
+ '2001-01-01-00:00'
+ ),
+ XSD.time: (
+ '00:00:00',
+ '00:00:00Z',
+ '00:00:00-00:00'
+ ),
+ XSD.gYear: (
+ '2001',
+ '2001Z',
+ '2001-00:00'
+ ), # interval
+ XSD.gYearMonth: (
+ '2001-01',
+ '2001-01Z',
+ '2001-01-00:00'
+ ),
+ }
+ literals = [
+ Literal(literal, datatype=t)
+ for t, literals in types.items()
+ for literal in literals
+ ]
+ try:
+ sorted(literals)
+ orderable = True
+ except TypeError as e:
+ for l in literals:
+ print(repr(l), repr(l.value))
+ print(e)
+ orderable = False
+ self.assertTrue(orderable)
+
+ # also make sure that within a datetime things are still ordered:
+ l1 = [
+ Literal(l, datatype=XSD.dateTime)
+ for l in [
+ '2001-01-01T00:00:00',
+ '2001-01-01T01:00:00',
+ '2001-01-01T01:00:01',
+ '2001-01-02T01:00:01',
+ '2001-01-01T00:00:00Z',
+ '2001-01-01T00:00:00-00:00',
+ '2001-01-01T01:00:00Z',
+ '2001-01-01T01:00:00-00:00',
+ '2001-01-01T00:00:00-01:30',
+ '2001-01-01T01:00:00-01:30',
+ '2001-01-02T01:00:01Z',
+ '2001-01-02T01:00:01-00:00',
+ '2001-01-02T01:00:01-01:30'
+ ]
+ ]
+ l2 = list(l1)
+ random.shuffle(l2)
+ self.assertListEqual(l1, sorted(l2))
+
+
+class TestValidityFunctions(unittest.TestCase):
+
+ def test_is_valid_unicode(self):
+ testcase_list = (
+ (None, True),
+ (1, True),
+ (['foo'], True),
+ ({'foo': b'bar'}, True),
+ ('foo', True),
+ (b'foo\x00', True),
+ (b'foo\xf3\x02', False)
+ )
+ for val, expected in testcase_list:
+ self.assertEqual(_is_valid_unicode(val), expected)
diff --git a/testbed/RDFLib__rdflib/test/test_trig_w3c.py b/testbed/RDFLib__rdflib/test/test_trig_w3c.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb8588e070df2f88003e6f89e40e9b37190b3966
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_trig_w3c.py
@@ -0,0 +1,85 @@
+"""Runs the tests for the W3C RDF Working Group's TriG test suite.
+
+"""
+
+from rdflib import ConjunctiveGraph
+from rdflib.namespace import split_uri
+from rdflib.compare import graph_diff, isomorphic
+
+from .manifest import nose_tests, RDFT
+from .testutils import nose_tst_earl_report
+
+verbose = False
+
+
+def trig(test):
+ g = ConjunctiveGraph()
+
+ try:
+ base = 'http://www.w3.org/2013/TriGTests/' + split_uri(test.action)[1]
+
+ g.parse(test.action, publicID=base, format='trig')
+ if not test.syntax:
+ raise AssertionError("Input shouldn't have parsed!")
+
+ if test.result: # eval test
+ res = ConjunctiveGraph()
+ res.parse(test.result, format='nquads')
+
+ if verbose:
+
+ both, first, second = graph_diff(g, res)
+ if not first and not second:
+ return
+
+ print('===============================')
+ print('TriG')
+ print(g.serialize(format='nquads'))
+ print('===============================')
+ print('NQuads')
+ print(res.serialize(format='nquads'))
+ print('===============================')
+
+ print("Diff:")
+ # print "%d triples in both"%len(both)
+ print("TriG Only:")
+ for t in first:
+ print(t)
+
+ print("--------------------")
+ print("NQuads Only")
+ for t in second:
+ print(t)
+ raise Exception('Graphs do not match!')
+
+ assert isomorphic(g, res), 'graphs must be the same'
+
+ except:
+ if test.syntax:
+ raise
+
+
+testers = {
+ RDFT.TestTrigPositiveSyntax: trig,
+ RDFT.TestTrigNegativeSyntax: trig,
+ RDFT.TestTrigEval: trig,
+ RDFT.TestTrigNegativeEval: trig
+}
+
+
+def test_trig(tests=None):
+ for t in nose_tests(testers, 'test/w3c/trig/manifest.ttl'):
+ if tests:
+ for test in tests:
+ if test in t[1].uri:
+ break
+ else:
+ continue
+
+ yield t
+
+
+if __name__ == '__main__':
+ verbose = True
+
+ nose_tst_earl_report(test_trig, 'rdflib_trig')
diff --git a/testbed/RDFLib__rdflib/test/test_trix_parse.py b/testbed/RDFLib__rdflib/test/test_trix_parse.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b0f9fb9ab612a2277122db6c5433a411d00edb2
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_trix_parse.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+
+from rdflib.graph import ConjunctiveGraph
+import unittest
+
+
+class TestTrixParse(unittest.TestCase):
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testAperture(self):
+
+ g = ConjunctiveGraph()
+
+ g.parse("test/trix/aperture.trix", format="trix")
+ c = list(g.contexts())
+
+ # print list(g.contexts())
+ t = sum(map(len, g.contexts()))
+
+ self.assertEqual(t, 24)
+ self.assertEqual(len(c), 4)
+
+ # print "Parsed %d triples"%t
+
+ def testSpec(self):
+
+ g = ConjunctiveGraph()
+
+ g.parse("test/trix/nokia_example.trix", format="trix")
+
+ # print "Parsed %d triples"%len(g)
+
+ def testNG4j(self):
+
+ g = ConjunctiveGraph()
+
+ g.parse("test/trix/ng4jtest.trix", format="trix")
+
+ # print "Parsed %d triples"%len(g)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_trix_serialize.py b/testbed/RDFLib__rdflib/test/test_trix_serialize.py
new file mode 100644
index 0000000000000000000000000000000000000000..f1b68de4623ae98334fc964dde02f6eb1cd5d260
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_trix_serialize.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+
+import unittest
+
+from rdflib.graph import ConjunctiveGraph
+from rdflib.term import URIRef, Literal
+from rdflib.graph import Graph
+from six import BytesIO
+
+
+class TestTrixSerialize(unittest.TestCase):
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testSerialize(self):
+
+ s1 = URIRef('store:1')
+ r1 = URIRef('resource:1')
+ r2 = URIRef('resource:2')
+
+ label = URIRef('predicate:label')
+
+ g1 = Graph(identifier=s1)
+ g1.add((r1, label, Literal("label 1", lang="en")))
+ g1.add((r1, label, Literal("label 2")))
+
+ s2 = URIRef('store:2')
+ g2 = Graph(identifier=s2)
+ g2.add((r2, label, Literal("label 3")))
+
+ g = ConjunctiveGraph()
+ for s, p, o in g1.triples((None, None, None)):
+ g.addN([(s, p, o, g1)])
+ for s, p, o in g2.triples((None, None, None)):
+ g.addN([(s, p, o, g2)])
+ r3 = URIRef('resource:3')
+ g.add((r3, label, Literal(4)))
+
+ r = g.serialize(format='trix')
+ g3 = ConjunctiveGraph()
+
+ g3.parse(BytesIO(r), format='trix')
+
+ for q in g3.quads((None, None, None)):
+ # TODO: Fix once getGraph/getContext is in conjunctive graph
+ if isinstance(q[3].identifier, URIRef):
+ tg = Graph(store=g.store, identifier=q[3].identifier)
+ else:
+ # BNode, this is a bit ugly
+ # we cannot match the bnode to the right graph automagically
+ # here I know there is only one anonymous graph,
+ # and that is the default one, but this is not always the case
+ tg = g.default_context
+ self.assertTrue(q[0:3] in tg)
+
+ def test_issue_250(self):
+ """
+
+ https://github.com/RDFLib/rdflib/issues/250
+
+ When I have a ConjunctiveGraph with the default namespace set,
+ for example
+
+ import rdflib
+ g = rdflib.ConjunctiveGraph()
+ g.bind(None, "http://defaultnamespace")
+
+ then the Trix serializer binds the default namespace twice in its XML
+ output, once for the Trix namespace and once for the namespace I used:
+
+ print(g.serialize(format='trix').decode('UTF-8'))
+
+
+
+
+ """
+
+ graph = ConjunctiveGraph()
+ graph.bind(None, "http://defaultnamespace")
+ sg = graph.serialize(format='trix').decode('UTF-8')
+ self.assertTrue(
+ 'xmlns="http://defaultnamespace"' not in sg, sg)
+ self.assertTrue(
+ 'xmlns="http://www.w3.org/2004/03/trix/trix-1/' in sg, sg)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_tsvresults.py b/testbed/RDFLib__rdflib/test/test_tsvresults.py
new file mode 100644
index 0000000000000000000000000000000000000000..d5222a34eae472fe41d14546aec1a76e8564b1b8
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_tsvresults.py
@@ -0,0 +1,20 @@
+import unittest
+from six import StringIO
+from rdflib.plugins.sparql.results.tsvresults import TSVResultParser
+
+
+class TestTSVResults(unittest.TestCase):
+
+ def test_empty_tsvresults_bindings(self):
+ # check that optional bindings are ordered properly
+ source = """?s\t?p\t?o
+ \t\t
+ \t\t
+ \t\t"""
+
+ parser = TSVResultParser()
+ source = StringIO(source)
+ result = parser.parse(source)
+
+ for idx, row in enumerate(result):
+ self.assertTrue(row[idx] is None)
diff --git a/testbed/RDFLib__rdflib/test/test_turtle_serialize.py b/testbed/RDFLib__rdflib/test/test_turtle_serialize.py
new file mode 100644
index 0000000000000000000000000000000000000000..0b602b347f1d5f78de795e9c1d82e2d45216c003
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_turtle_serialize.py
@@ -0,0 +1,76 @@
+from rdflib import Graph, URIRef, BNode, RDF, Literal, Namespace
+from rdflib.collection import Collection
+from rdflib.plugins.serializers.turtle import TurtleSerializer
+from six import b
+
+
+def testTurtleFinalDot():
+ """
+ https://github.com/RDFLib/rdflib/issues/282
+ """
+
+ g = Graph()
+ u = URIRef("http://ex.org/bob.")
+ g.bind("ns", "http://ex.org/")
+ g.add((u, u, u))
+ s = g.serialize(format='turtle')
+ assert b("ns:bob.") not in s
+
+
+def testTurtleBoolList():
+ subject = URIRef("http://localhost/user")
+ predicate = URIRef("http://localhost/vocab#hasList")
+ g1 = Graph()
+ list_item1 = BNode()
+ list_item2 = BNode()
+ list_item3 = BNode()
+ g1.add((subject, predicate, list_item1))
+ g1.add((list_item1, RDF.first, Literal(True)))
+ g1.add((list_item1, RDF.rest, list_item2))
+ g1.add((list_item2, RDF.first, Literal(False)))
+ g1.add((list_item2, RDF.rest, list_item3))
+ g1.add((list_item3, RDF.first, Literal(True)))
+ g1.add((list_item3, RDF.rest, RDF.nil))
+
+ ttl_dump = g1.serialize(format="turtle")
+ g2 = Graph()
+ g2.parse(data=ttl_dump, format="turtle")
+
+ list_id = g2.value(subject, predicate)
+ bool_list = [i.toPython() for i in Collection(g2, list_id)]
+ assert bool_list == [True, False, True]
+
+
+def testUnicodeEscaping():
+ turtle_string = " . . ."
+ g = Graph()
+
+ # shouldn't get an exception
+ g.parse(data=turtle_string, format="turtle")
+ triples = sorted(list(g))
+ assert len(triples) == 3
+ print(triples)
+ # Now check that was decoded into python values properly
+ assert triples[0][2] == URIRef(u'http://example.com/aaa\xf3bbbb')
+ assert triples[1][2] == URIRef(u'http://example.com/zzz\U00100000zzz')
+ assert triples[2][2] == URIRef(u'http://example.com/aaa\xf3bbb')
+
+
+def test_turtle_valid_list():
+ NS = Namespace('http://example.org/ns/')
+ g = Graph()
+ g.parse(data="""
+ @prefix : <{0}> .
+ :s :p (""), (0), (false) .
+ """.format(NS), format='turtle')
+
+ turtle_serializer = TurtleSerializer(g)
+
+ for o in g.objects(NS.s, NS.p):
+ assert turtle_serializer.isValidList(o)
+
+
+if __name__ == "__main__":
+ import nose
+ import sys
+ nose.main(defaultTest=sys.argv[0])
diff --git a/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py b/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py
new file mode 100644
index 0000000000000000000000000000000000000000..f81cba335cab02b3a80b3a2a35d4b61a6b75b797
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_turtle_sort_issue613.py
@@ -0,0 +1,40 @@
+import rdflib
+
+"""
+In py3, some objects are not comparable. When the turtle serializer tries to sort them everything breaks.
+
+* Timezone aware datetime objects and "naive" datetime objects are not comparable
+
+https://github.com/RDFLib/rdflib/issues/648
+https://github.com/RDFLib/rdflib/issues/613
+
+* DocumentFragment
+https://github.com/RDFLib/rdflib/issues/676
+
+"""
+
+
+def test_sort_dates():
+
+ g = rdflib.Graph()
+ y = '''@prefix ex: .
+ex:X ex:p "2016-01-01T00:00:00"^^, "2016-01-01T00:00:00Z"^^ . '''
+
+ p = g.parse(data=y, format="turtle")
+ p.serialize(format="turtle")
+
+
+def test_sort_docfrag():
+
+ g = rdflib.Graph()
+ y = '''@prefix ex: .
+@prefix rdf: .
+ex:X ex:p "hi
"^^rdf:HTML, "ho
"^^rdf:HTML . '''
+
+ p = g.parse(data=y, format="turtle")
+ p.serialize(format="turtle")
+
+
+if __name__ == '__main__':
+
+ test_sort_docfrag()
diff --git a/testbed/RDFLib__rdflib/test/test_turtle_w3c.py b/testbed/RDFLib__rdflib/test/test_turtle_w3c.py
new file mode 100644
index 0000000000000000000000000000000000000000..469ed02383733bc44fc80bbc277daa482e36e228
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_turtle_w3c.py
@@ -0,0 +1,76 @@
+"""This runs the turtle tests for the W3C RDF Working Group's N-Quads
+test suite."""
+
+from rdflib import Graph
+from rdflib.namespace import split_uri
+from rdflib.compare import graph_diff, isomorphic
+
+from .manifest import nose_tests, RDFT
+from .testutils import nose_tst_earl_report
+
+verbose = False
+
+
+def turtle(test):
+ g = Graph()
+
+ try:
+ base = 'http://www.w3.org/2013/TurtleTests/' + split_uri(test.action)[1]
+
+ g.parse(test.action, publicID=base, format='turtle')
+ if not test.syntax:
+ raise AssertionError("Input shouldn't have parsed!")
+
+ if test.result: # eval test
+ res = Graph()
+ res.parse(test.result, format='nt')
+
+ if verbose:
+ both, first, second = graph_diff(g, res)
+ if not first and not second:
+ return
+ print("Diff:")
+ # print "%d triples in both"%len(both)
+ print("Turtle Only:")
+ for t in first:
+ print(t)
+
+ print("--------------------")
+ print("NT Only")
+ for t in second:
+ print(t)
+ raise Exception('Graphs do not match!')
+
+ assert isomorphic(g, res), 'graphs must be the same'
+
+ except:
+ if test.syntax:
+ raise
+
+
+testers = {
+ RDFT.TestTurtlePositiveSyntax: turtle,
+ RDFT.TestTurtleNegativeSyntax: turtle,
+ RDFT.TestTurtleEval: turtle,
+ RDFT.TestTurtleNegativeEval: turtle
+}
+
+
+def test_turtle(tests=None):
+ for t in nose_tests(testers,
+ 'test/w3c/turtle/manifest.ttl'):
+ if tests:
+ for test in tests:
+ if test in t[1].uri:
+ break
+ else:
+ continue
+
+ yield t
+
+
+if __name__ == '__main__':
+
+ verbose = True
+
+ nose_tst_earl_report(test_turtle, 'rdflib_turtle')
diff --git a/testbed/RDFLib__rdflib/test/test_util.py b/testbed/RDFLib__rdflib/test/test_util.py
new file mode 100644
index 0000000000000000000000000000000000000000..61e5b33c2ccef0c654a3f7cc91b651a713afc93b
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_util.py
@@ -0,0 +1,350 @@
+import unittest
+import time
+from rdflib.graph import Graph
+from rdflib.graph import QuotedGraph
+from rdflib.graph import ConjunctiveGraph
+from rdflib.term import BNode
+from rdflib.term import Literal
+from rdflib.term import URIRef
+from rdflib import util
+from rdflib import XSD
+from rdflib.exceptions import SubjectTypeError
+from rdflib.exceptions import PredicateTypeError
+from rdflib.exceptions import ObjectTypeError
+from rdflib.exceptions import ContextTypeError
+
+n3source = """\
+@prefix : .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix owl: .
+@prefix dc: .
+@prefix foo: .
+@prefix swap: .
+
+<> dc:title
+ "Primer - Getting into the Semantic Web and RDF using N3".
+
+<#pat> <#knows> <#jo> .
+<#pat> <#age> 24 .
+<#al> is <#child> of <#pat> .
+
+<#pat> <#child> <#al>, <#chaz>, <#mo> ;
+ <#age> 24 ;
+ <#eyecolor> "blue" .
+
+:Person a rdfs:Class.
+
+:Pat a :Person.
+
+:Woman a rdfs:Class; rdfs:subClassOf :Person .
+
+:sister a rdf:Property.
+
+:sister rdfs:domain :Person;
+ rdfs:range :Woman.
+
+:Woman = foo:FemaleAdult .
+:Title a rdf:Property; = dc:title .
+
+""" # --- End of primer code
+
+
+class TestUtilMisc(unittest.TestCase):
+ def setUp(self):
+ self.x = Literal("2008-12-01T18:02:00Z",
+ datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime'))
+
+ def test_util_list2set(self):
+ base = [Literal('foo'), self.x]
+ r = util.list2set(base + base)
+ self.assertTrue(r == base)
+
+ def test_util_uniq(self):
+ base = ["michel", "hates", "pizza"]
+ r = util.uniq(base + base)
+ self.assertEqual(sorted(r), sorted(base))
+ base = ["michel", "hates", "pizza"]
+ r = util.uniq(base + base, strip=True)
+ self.assertEqual(sorted(r), sorted(base))
+
+ def test_coverage_dodge(self):
+ util.test()
+
+
+class TestUtilDateTime(unittest.TestCase):
+
+ def setUp(self):
+ self.x = Literal("2008-12-01T18:02:00Z",
+ datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime'))
+
+ def test_util_date_time_tisnoneandnotz(self):
+ t = None
+ res = util.date_time(t, local_time_zone=False)
+ self.assertTrue(res[4:5] == "-")
+
+ def test_util_date_time_tisnonebuttz(self):
+ t = None
+ res = util.date_time(t, local_time_zone=True)
+ self.assertTrue(res[4:5] == "-")
+
+ def test_util_date_time_tistime(self):
+ t = time.time()
+ res = util.date_time(t, local_time_zone=False)
+ self.assertTrue(res[4:5] == "-")
+
+ def test_util_date_time_tistimewithtz(self):
+ t = time.time()
+ res = util.date_time(t, local_time_zone=True)
+ self.assertTrue(res[4:5] == "-")
+
+ def test_util_parse_date_time(self):
+ t = time.time()
+ res = util.parse_date_time("1970-01-01")
+ self.assertTrue(res is not t)
+
+ def test_util_parse_date_timewithtz(self):
+ t = time.time()
+ res = util.parse_date_time("1970-01-01")
+ self.assertTrue(res is not t)
+
+ def test_util_date_timewithtoutz(self):
+ t = time.time()
+
+ def ablocaltime(t):
+ from time import gmtime
+ res = gmtime(t)
+ return res
+ util.localtime = ablocaltime
+ res = util.date_time(t, local_time_zone=True)
+ self.assertTrue(res is not t)
+
+
+class TestUtilTermConvert(unittest.TestCase):
+ def setUp(self):
+ self.x = Literal("2008-12-01T18:02:00Z",
+ datatype=URIRef('http://www.w3.org/2001/XMLSchema#dateTime'))
+
+ def test_util_to_term_sisNone(self):
+ s = None
+ self.assertEqual(util.to_term(s), s)
+ self.assertEqual(util.to_term(s, default=""), "")
+
+ def test_util_to_term_sisstr(self):
+ s = '"http://example.com"'
+ res = util.to_term(s)
+ self.assertTrue(isinstance(res, Literal))
+ self.assertEqual(str(res), s[1:-1])
+
+ def test_util_to_term_sisurl(self):
+ s = ""
+ res = util.to_term(s)
+ self.assertTrue(isinstance(res, URIRef))
+ self.assertEqual(str(res), s[1:-1])
+
+ def test_util_to_term_sisbnode(self):
+ s = '_http%23%4F%4Fexample%33com'
+ res = util.to_term(s)
+ self.assertTrue(isinstance(res, BNode))
+
+ def test_util_to_term_sisunknown(self):
+ s = 'http://example.com'
+ self.assertRaises(Exception, util.to_term, s)
+
+ def test_util_to_term_sisnotstr(self):
+ s = self.x
+ self.assertRaises(Exception, util.to_term, s)
+
+ def test_util_from_n3_sisnonenodefault(self):
+ s = None
+ default = None
+ res = util.from_n3(s, default=default, backend=None)
+ self.assertTrue(res == default)
+
+ def test_util_from_n3_sisnonewithdefault(self):
+ s = None
+ default = "TestofDefault"
+ res = util.from_n3(s, default=default, backend=None)
+ self.assertTrue(res == default)
+
+ def test_util_from_n3_expectdefaultbnode(self):
+ s = "michel"
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, BNode))
+
+ def test_util_from_n3_expectbnode(self):
+ s = "_:michel"
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, BNode))
+
+ def test_util_from_n3_expectliteral(self):
+ s = '"michel"'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, Literal))
+
+ def test_util_from_n3_expecturiref(self):
+ s = ''
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, URIRef))
+
+ def test_util_from_n3_expectliteralandlang(self):
+ s = '"michel"@fr'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, Literal))
+
+ def test_util_from_n3_expectliteralandlangdtype(self):
+ s = '"michel"@fr^^xsd:fr'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(isinstance(res, Literal))
+ self.assertEqual(res, Literal('michel',
+ datatype=XSD['fr']))
+
+ def test_util_from_n3_expectliteralanddtype(self):
+ s = '"true"^^xsd:boolean'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(res.eq(Literal('true', datatype=XSD['boolean'])))
+
+ def test_util_from_n3_expectliteralwithdatatypefromint(self):
+ s = '42'
+ res = util.from_n3(s)
+ self.assertEqual(res, Literal(42))
+
+ def test_util_from_n3_expectliteralwithdatatypefrombool(self):
+ s = 'true'
+ res = util.from_n3(s)
+ self.assertEqual(res, Literal(True))
+ s = 'false'
+ res = util.from_n3(s)
+ self.assertEqual(res, Literal(False))
+
+ def test_util_from_n3_expectliteralmultiline(self):
+ s = '"""multi\nline\nstring"""@en'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(res, Literal('multi\nline\nstring', lang='en'))
+
+ def test_util_from_n3_expectliteralwithescapedquote(self):
+ s = '"\\""'
+ res = util.from_n3(s, default=None, backend=None)
+ self.assertTrue(res, Literal('\\"', lang='en'))
+
+ def test_util_from_n3_expectliteralwithtrailingbackslash(self):
+ s = '"trailing\\\\"^^'
+ res = util.from_n3(s)
+ self.assertTrue(res, Literal('trailing\\', datatype=XSD['string']))
+ self.assertTrue(res.n3(), s)
+
+ def test_util_from_n3_expectpartialidempotencewithn3(self):
+ for n3 in ('',
+ '"foo"@de',
+ # '"\\""', # exception as '\\"' --> '"' by orig parser as well
+ '"""multi\n"line"\nstring"""@en'):
+ self.assertEqual(util.from_n3(n3).n3(), n3,
+ 'from_n3(%(n3e)r).n3() != %(n3e)r' % {'n3e': n3})
+
+ def test_util_from_n3_expectsameasn3parser(self):
+ def parse_n3(term_n3):
+ ''' Disclaimer: Quick and dirty hack using the n3 parser. '''
+ prepstr = ("@prefix xsd: .\n"
+ " %s.\n" % term_n3)
+ g = ConjunctiveGraph()
+ g.parse(data=prepstr, format='n3')
+ return [t for t in g.triples((None, None, None))][0][2]
+
+ for n3 in ( # "michel", # won't parse in original parser
+ # "_:michel", # BNodes won't be the same
+ '"michel"',
+ '',
+ '"michel"@fr',
+ # '"michel"@fr^^xsd:fr', # FIXME: invalid n3, orig parser will prefer datatype
+ # '"true"^^xsd:boolean', # FIXME: orig parser will expand xsd prefix
+ '42',
+ 'true',
+ 'false',
+ '"""multi\nline\nstring"""@en',
+ '',
+ '"foo"@de',
+ '"\\""@en',
+ '"""multi\n"line"\nstring"""@en'):
+ res, exp = util.from_n3(n3), parse_n3(n3)
+ self.assertEqual(res, exp,
+ 'from_n3(%(n3e)r): %(res)r != parser.notation3: %(exp)r' % {
+ 'res': res, 'exp': exp, 'n3e': n3})
+
+ def test_util_from_n3_expectquotedgraph(self):
+ s = '{}'
+ res = util.from_n3(s, default=None, backend="IOMemory")
+ self.assertTrue(isinstance(res, QuotedGraph))
+
+ def test_util_from_n3_expectgraph(self):
+ s = '[]'
+ res = util.from_n3(s, default=None, backend="IOMemory")
+ self.assertTrue(isinstance(res, Graph))
+
+
+class TestUtilCheckers(unittest.TestCase):
+ def setUp(self):
+ self.c = URIRef("http://example.com")
+ self.s = BNode("http://example.com")
+ self.p = URIRef("http://example.com/predicates/isa")
+ self.o = Literal("Objectification")
+
+ def test_util_checker_exceptions(self):
+ c = "http://example.com"
+ self.assertRaises(ContextTypeError, util.check_context, c)
+ self.assertRaises(SubjectTypeError, util.check_subject, c)
+ self.assertRaises(PredicateTypeError, util.check_predicate, c)
+ self.assertRaises(ObjectTypeError, util.check_object, c)
+
+ def test_util_check_context(self):
+ res = util.check_context(self.c)
+ self.assertTrue(res == None)
+
+ def test_util_check_subject(self):
+ res = util.check_subject(self.s)
+ self.assertTrue(res == None)
+
+ def test_util_check_predicate(self):
+ res = util.check_predicate(self.p)
+ self.assertTrue(res == None)
+
+ def test_util_check_object(self):
+ res = util.check_object(self.o)
+ self.assertTrue(res == None)
+
+ def test_util_check_statement(self):
+ c = "http://example.com"
+ self.assertRaises(
+ SubjectTypeError,
+ util.check_statement,
+ (c, self.p, self.o))
+ self.assertRaises(
+ PredicateTypeError,
+ util.check_statement,
+ (self.s, c, self.o))
+ self.assertRaises(
+ ObjectTypeError,
+ util.check_statement,
+ (self.s, self.p, c))
+ res = util.check_statement((self.s, self.p, self.o))
+ self.assertTrue(res == None)
+
+ def test_util_check_pattern(self):
+ c = "http://example.com"
+ self.assertRaises(
+ SubjectTypeError,
+ util.check_pattern,
+ (c, self.p, self.o))
+ self.assertRaises(
+ PredicateTypeError,
+ util.check_pattern,
+ (self.s, c, self.o))
+ self.assertRaises(
+ ObjectTypeError,
+ util.check_pattern,
+ (self.s, self.p, c))
+ res = util.check_pattern((self.s, self.p, self.o))
+ self.assertTrue(res == None)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/test_wide_python.py b/testbed/RDFLib__rdflib/test/test_wide_python.py
new file mode 100644
index 0000000000000000000000000000000000000000..feef4519ba8a12001c662d698eeea02eaccbbf8d
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_wide_python.py
@@ -0,0 +1,14 @@
+
+def test_wide_python_build():
+ """This test is meant to fail on narrow python builds (common on Mac OS X).
+
+ See https://github.com/RDFLib/rdflib/issues/456 for more information.
+ """
+ assert len(u'\U0010FFFF') == 1, (
+ 'You are using a narrow Python build!\n'
+ 'This means that your Python does not properly support chars > 16bit.\n'
+ 'On your system chars like c=u"\\U0010FFFF" will have a len(c)==2.\n'
+ 'As this can cause hard to debug problems with string processing\n'
+ '(slicing, regexp, ...) later on, we strongly advise to use a wide\n'
+ 'Python build in production systems.'
+ )
diff --git a/testbed/RDFLib__rdflib/test/test_xmlliterals.py b/testbed/RDFLib__rdflib/test/test_xmlliterals.py
new file mode 100644
index 0000000000000000000000000000000000000000..b467e82a3758891dbe28369f7f0b2dc19d541165
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/test_xmlliterals.py
@@ -0,0 +1,84 @@
+import rdflib
+from rdflib import RDF, Graph, Literal
+
+
+def testPythonRoundtrip():
+ l1 = Literal('hello', datatype=RDF.XMLLiteral)
+ assert l1.value is not None, 'xml must have been parsed'
+ assert l1.datatype == RDF.XMLLiteral, 'literal must have right datatype'
+
+ l2 = Literal('good morning', datatype=RDF.XMLLiteral)
+ assert l2.value is not None, 'xml must have been parsed'
+ assert not l1.eq(l2), 'literals must NOT be equal'
+
+ l3 = Literal(l1.value)
+ assert l1.eq(l3), 'roundtripped literals must be equal'
+ assert l3.datatype == RDF.XMLLiteral, 'literal must have right datatype'
+
+ l4 = Literal('hello', datatype=RDF.XMLLiteral)
+ assert l1 == l4
+ assert l1.eq(l4)
+
+ rdflib.NORMALIZE_LITERALS = False
+ l4 = Literal('hello', datatype=RDF.XMLLiteral)
+ assert l1 != l4
+ assert l1.eq(l4)
+ rdflib.NORMALIZE_LITERALS = True
+
+
+def testRDFXMLParse():
+ rdfxml = """\
+
+
+
+
+
+
+
+
+"""
+
+ g = rdflib.Graph()
+ g.parse(data=rdfxml)
+ l1 = list(g)[0][2]
+ assert l1.datatype == RDF.XMLLiteral
+
+
+def graph():
+ g = rdflib.Graph()
+ g.add((rdflib.URIRef('http://example.org/a'),
+ rdflib.URIRef('http://example.org/p'),
+ rdflib.Literal('hei', datatype=RDF.XMLLiteral)))
+ return g
+
+
+def roundtrip(fmt):
+ g1 = graph()
+ l1 = list(g1)[0][2]
+ g2 = rdflib.Graph()
+ g2.parse(data=g1.serialize(format=fmt), format=fmt)
+ l2 = list(g2)[0][2]
+ assert l1.eq(l2)
+
+
+def testRoundtrip():
+ roundtrip('xml')
+ roundtrip('n3')
+ roundtrip('nt')
+
+
+def testHTML():
+
+ l1 = Literal('hello', datatype=RDF.XMLLiteral)
+ assert l1.value is not None, 'xml must have been parsed'
+ assert l1.datatype == RDF.XMLLiteral, 'literal must have right datatype'
+
+ l2 = Literal('hello', datatype=RDF.HTML)
+ assert l2.value is not None, 'xml must have been parsed'
+ assert l2.datatype == RDF.HTML, 'literal must have right datatype'
+
+ assert l1 != l2
+ assert not l1.eq(l2)
diff --git a/testbed/RDFLib__rdflib/test/testutils.py b/testbed/RDFLib__rdflib/test/testutils.py
new file mode 100644
index 0000000000000000000000000000000000000000..02bc4b231af0d82af3db04f27c0298475a13b6eb
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/testutils.py
@@ -0,0 +1,103 @@
+from __future__ import print_function
+
+import sys
+import isodate
+import datetime
+
+from traceback import print_exc
+from nose import SkipTest
+from .earl import add_test, report
+
+from rdflib import BNode, Graph, ConjunctiveGraph
+
+
+# TODO: make an introspective version (like this one) of
+# rdflib.graphutils.isomorphic and use instead.
+def crapCompare(g1, g2):
+ """A really crappy way to 'check' if two graphs are equal. It ignores blank
+ nodes completely and ignores subgraphs."""
+ if len(g1) != len(g2):
+ raise Exception("Graphs dont have same length")
+ for t in g1:
+ s = _no_blank(t[0])
+ o = _no_blank(t[2])
+ if not (s, t[1], o) in g2:
+ e = "(%s, %s, %s) is not in both graphs!" % (s, t[1], o)
+ raise Exception(e)
+
+
+def _no_blank(node):
+ if isinstance(node, BNode):
+ return None
+ if isinstance(node, Graph):
+ return None # node._Graph__identifier = _SQUASHED_NODE
+ return node
+
+
+def check_serialize_parse(fpath, infmt, testfmt, verbose=False):
+ g = ConjunctiveGraph()
+ _parse_or_report(verbose, g, fpath, format=infmt)
+ if verbose:
+ for t in g:
+ print(t)
+ print("========================================")
+ print("Parsed OK!")
+ s = g.serialize(format=testfmt)
+ if verbose:
+ print(s)
+ g2 = ConjunctiveGraph()
+ _parse_or_report(verbose, g2, data=s, format=testfmt)
+ if verbose:
+ print(g2.serialize())
+ crapCompare(g, g2)
+
+
+def _parse_or_report(verbose, graph, *args, **kwargs):
+ try:
+ graph.parse(*args, **kwargs)
+ except:
+ if verbose:
+ print("========================================")
+ print("Error in parsing serialization:")
+ print(args, kwargs)
+ raise
+
+
+def nose_tst_earl_report(generator, earl_report_name=None):
+ from optparse import OptionParser
+ p = OptionParser()
+ (options, args) = p.parse_args()
+
+ skip = 0
+ tests = 0
+ success = 0
+
+ for t in generator(args):
+ tests += 1
+ print('Running ', t[1].uri)
+ try:
+ t[0](t[1])
+ add_test(t[1].uri, "passed")
+ success += 1
+ except SkipTest as e:
+ add_test(t[1].uri, "untested", e.message)
+ print("skipping %s - %s" % (t[1].uri, e.message))
+ skip += 1
+
+ except KeyboardInterrupt:
+ raise
+ except AssertionError:
+ add_test(t[1].uri, "failed")
+ except:
+ add_test(t[1].uri, "failed", "error")
+ print_exc()
+ sys.stderr.write("%s\n" % t[1].uri)
+
+ print("Ran %d tests, %d skipped, %d failed. "%(tests, skip, tests-skip-success))
+ if earl_report_name:
+ now = isodate.datetime_isoformat(datetime.datetime.utcnow())
+ earl_report = 'test_reports/%s-%s.ttl' % (earl_report_name, now)
+
+ report.serialize(earl_report, format='n3')
+ report.serialize('test_reports/%s-latest.ttl'%earl_report_name, format='n3')
+ print("Wrote EARL-report to '%s'" % earl_report)
diff --git a/testbed/RDFLib__rdflib/test/triple_store.py b/testbed/RDFLib__rdflib/test/triple_store.py
new file mode 100644
index 0000000000000000000000000000000000000000..b9c5221ab0bd0ce70d59101279afe8ae9810792a
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/triple_store.py
@@ -0,0 +1,35 @@
+import unittest
+
+from rdflib.term import BNode, Literal
+from rdflib.namespace import RDFS
+from rdflib.graph import Graph
+
+
+class GraphTest(unittest.TestCase):
+ backend = 'default'
+ path = 'store'
+
+ def setUp(self):
+ self.store = Graph(store=self.backend)
+ self.store.open(self.path)
+ self.remove_me = (BNode(), RDFS.label, Literal("remove_me"))
+ self.store.add(self.remove_me)
+
+ def tearDown(self):
+ self.store.close()
+
+ def testAdd(self):
+ subject = BNode()
+ self.store.add((subject, RDFS.label, Literal("foo")))
+
+ def testRemove(self):
+ self.store.remove(self.remove_me)
+ self.store.remove((None, None, None))
+
+ def testTriples(self):
+ for s, p, o in self.store:
+ pass
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testbed/RDFLib__rdflib/test/type_check.py b/testbed/RDFLib__rdflib/test/type_check.py
new file mode 100644
index 0000000000000000000000000000000000000000..605f09161778229343e5e2a59858e71c826eab68
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test/type_check.py
@@ -0,0 +1,34 @@
+import unittest
+
+from rdflib.graph import Graph
+from rdflib.exceptions import SubjectTypeError
+from rdflib.exceptions import PredicateTypeError
+from rdflib.exceptions import ObjectTypeError
+from rdflib.term import URIRef
+
+foo = URIRef("foo")
+
+
+class TypeCheckCase(unittest.TestCase):
+ unstable = True # TODO: until we decide if we want to add type checking back to rdflib
+ backend = 'default'
+ path = 'store'
+
+ def setUp(self):
+ self.store = Graph(backend=self.backend)
+ self.store.open(self.path)
+
+ def tearDown(self):
+ self.store.close()
+
+ def testSubjectTypeCheck(self):
+ self.assertRaises(SubjectTypeError,
+ self.store.add, (None, foo, foo))
+
+ def testPredicateTypeCheck(self):
+ self.assertRaises(PredicateTypeError,
+ self.store.add, (foo, None, foo))
+
+ def testObjectTypeCheck(self):
+ self.assertRaises(ObjectTypeError,
+ self.store.add, (foo, foo, None))
diff --git a/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl b/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl
new file mode 100644
index 0000000000000000000000000000000000000000..344e186111dde9af8c0a4812bb6c71d51854c0ed
--- /dev/null
+++ b/testbed/RDFLib__rdflib/test_reports/rdflib_nquads-2013-12-22T19:22:34.ttl
@@ -0,0 +1,697 @@
+@prefix dc: .
+@prefix doap: .
+@prefix earl: .
+@prefix foaf: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix xml: .
+@prefix xsd: .
+
+ a foaf:Person ;
+ foaf:homepage ;
+ foaf:name "Gunnar Aastrand Grimnes" .
+
+ a doap:Project ;
+ doap:homepage ;
+ doap:name "rdflib" .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject ;
+ earl:test .
+
+[] a earl:Assertion ;
+ dc:date "2013-12-22T20:22:33.975728"^^xsd:dateTime ;
+ earl:assertedBy ;
+ earl:result [ a earl:TestResult ;
+ earl:outcome earl:passed ] ;
+ earl:subject