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 JSON-LD document into RDFLib graph. | |
The schema of @base IRI can lead RDFLib to silently refuse the import. | |
This is supplementary code for: https://github.com/RDFLib/rdflib-jsonld/issues/97 | |
""" | |
import json | |
import textwrap |
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
""" | |
Question about importing JSON-LD @graph contents into a named graph with | |
specifically provided IRI instead of an IRI taken from the @id. | |
Published at: | |
https://gist.github.com/anatoly-scherbakov/e1c75db34a262f7aa107d82399c50c52 | |
This is supplementary material for this StackOverflow question: |
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
""" | |
Question about importing JSON-LD @included contents. | |
Published at: | |
https://gist.github.com/anatoly-scherbakov/d5ddeb6a0a8651ba5d148aa36a752699 | |
This is supplementary material for this GitHub issue: | |
https://github.com/RDFLib/rdflib-jsonld/issues/98 |
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> ; |
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
""" | |
Test import JSON-LD documents with different IRI schemes. | |
Supplementary material for: | |
https://github.com/RDFLib/rdflib-jsonld/issues/101 | |
""" | |
import json | |
import rdflib |
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
from enum import Enum | |
from typing import Optional, Generic, TypeVar, Set | |
from fastapi import FastAPI, Depends | |
from pydantic import BaseModel | |
from pydantic.fields import ModelField | |
ContainerType = TypeVar('ContainerType') | |
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
from enum import Enum | |
from typing import Optional, Generic, TypeVar, Set | |
from pydantic import BaseModel, version | |
from pydantic.fields import ModelField | |
from pydantic.schema import model_schema | |
ContainerType = TypeVar('ContainerType') | |
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 json | |
from typing import List, Generic, TypeVar | |
from pydantic import Json, Field, BaseModel | |
from pydantic.generics import GenericModel | |
MessageType = TypeVar('MessageType') | |
RecordType = TypeVar('RecordType') | |
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 logging | |
from sys import version as python_version | |
from rdflib import RDF, SDO, ConjunctiveGraph, Literal, URIRef | |
from rdflib import __version__ as rdflib_version | |
from rdflib import plugin | |
from rdflib.store import Store | |
from rdflib_sqlalchemy import __version__ as rdflib_sqlalchemy_version | |
logger = logging.getLogger(__name__) |
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 logging | |
import sys | |
import owlrl | |
import rdflib | |
from owlrl import OWLRL_Extension | |
from rdflib import Graph, Literal | |
logger = logging.getLogger(__name__) |