Created
December 19, 2020 07:38
-
-
Save anatoly-scherbakov/9fafb2863b877991f56ac7766b7c1bf0 to your computer and use it in GitHub Desktop.
RDFLib: import N3 data with @base IRI which does not include a slash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rdflib | |
DOCUMENT = """ | |
@base <local:> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
<class_to_class> | |
a | |
rdfs:Class , | |
<Category> ; | |
<color> "blue" ; | |
<priority> 4 . | |
""" | |
def test_no_slash_after_colon(): | |
"""Test @base directive with no slash after colon.""" | |
graph = rdflib.ConjunctiveGraph() | |
graph.parse( | |
data=DOCUMENT, | |
format='n3', | |
) | |
# Raises ValueError: | |
# Base <local:> has no slash after colon - with relative 'class_to_class'. | |
# But perfectly works if to use <local:/> or <local://> as @base. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment