Skip to content

Commit

Permalink
Merge branch 'main' into issue-2053-remove-unused-open
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondchuc committed Mar 13, 2024
2 parents b43f2ba + 9834665 commit a51edbf
Show file tree
Hide file tree
Showing 105 changed files with 1,800 additions and 740 deletions.
2 changes: 1 addition & 1 deletion devtools/requirements-poetry.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Fixing this here as readthedocs can't use the compiled requirements-poetry.txt
# due to conflicts.
poetry==1.8.2
poetry==1.7.1
1 change: 1 addition & 0 deletions examples/berkeleydb_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* loads multiple graphs downloaded from GitHub into a BerkeleyDB-baked graph stored in the folder gsq_vocabs.
* does not delete the DB at the end so you can see it on disk
"""

import os
import tempfile

Expand Down
1 change: 0 additions & 1 deletion examples/custom_datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
mappings between literal datatypes and Python objects
"""


from rdflib import XSD, Graph, Literal, Namespace, term

if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion examples/custom_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
}
"""


from pathlib import Path

import rdflib
Expand Down
10 changes: 4 additions & 6 deletions examples/jsonld_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
"schema": "https://schema.org/"
}
"""

# import RDFLib and other things
import json
try:
from rdflib import Graph
except ModuleNotFoundError as e:
except ModuleNotFoundError:
import sys
from pathlib import Path

sys.path.append(str(Path(__file__).parent.parent))
from rdflib import Graph

Expand Down Expand Up @@ -177,10 +178,7 @@

# 2.3 Compact the JSON-LD by supplying own context
# We now override RDFLib's namespace prefixes by supplying our own context information
context = {
"sdo": "https://schema.org/",
"dct": "http://purl.org/dc/terms/"
}
context = {"sdo": "https://schema.org/", "dct": "http://purl.org/dc/terms/"}

# Now when we serialise the RDF data, this context can be used to overwrite the default RDFLib one. auto_compact need not be specified
print(g.serialize(format="json-ld", context=context))
Expand Down
1 change: 1 addition & 0 deletions examples/secure_with_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
The code in the example then verifies that the audit hook is blocking access to
URLs and files as expected.
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions examples/secure_with_urlopen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates how to use a custom global URL opener installed with `urllib.request.install_opener` to block access to URLs.
"""

from __future__ import annotations

import http.client
Expand Down
14 changes: 2 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rdflib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
True
"""

import logging
import sys
from importlib import metadata
Expand Down
1 change: 1 addition & 0 deletions rdflib/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
_:cb558f30e21ddfc05ca53108348338ade8
<http://example.org/ns#label> "B" .
"""

from __future__ import annotations

# TODO:
Expand Down
1 change: 1 addition & 0 deletions rdflib/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
TODO:
"""

from __future__ import annotations

__all__ = [
Expand Down
1 change: 1 addition & 0 deletions rdflib/extras/external_graph_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
networkx or graph_tool are available and they would err otherwise.
see ../../test/test_extras_external_graph_libs.py for conditional tests
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions rdflib/extras/infixowl.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
>>> print(g.serialize(format='pretty-xml')) # doctest: +SKIP
"""

from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions rdflib/extras/shacl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities for interacting with SHACL Shapes Graphs more easily.
"""

from __future__ import annotations

from typing import Optional, Union
Expand Down
Loading

0 comments on commit a51edbf

Please sign in to comment.