As a user, I wanted to visualize the DCATDataSet that is created here with the visualization code taken from here (please ignore the erd setup code for PATH):
import os
import pathlib
import sys
if sys.platform == "win32":
path = pathlib.Path(r"C:\Users\LeimgruberF\scoop\apps\graphviz\7.0.1\bin")
if path.is_dir() and str(path) not in os.environ["PATH"]:
os.environ["PATH"] += f";{path}"
import erdantic as erd
from rdflib import URIRef
from sempyro import LiteralField
from sempyro.dcat import DCATCatalog, DCATDataset
catalog_title = LiteralField(value="Example Data Catalog")
catalog_desc = LiteralField(value="This is an example data catalog that contains a single dataset.")
dataset_subject = URIRef("http://example.com/dataset/population")
catalog = DCATCatalog(title=[catalog_title], description=[catalog_desc], dataset=[dataset_subject])
dataset_title = LiteralField(value="Population statistics")
description = LiteralField(value="This is description of Test dataset")
dataset = DCATDataset(title=[dataset_title],
description=[description],
)
erd.draw(catalog, out="catalog.png")
erd.draw(dataset, out="dataset.png")
which fails with:
File "c:\Users\LeimgruberF\dev\ease-data-spaces\.venv\Lib\site-packages\erdantic\convenience.py", line 143, in draw
diagram = create(
^^^^^^^
File "c:\Users\LeimgruberF\dev\ease-data-spaces\.venv\Lib\site-packages\erdantic\convenience.py", line 67, in create
diagram.add_model(mm)
File "c:\Users\LeimgruberF\dev\ease-data-spaces\.venv\Lib\site-packages\erdantic\core.py", line 575, in add_model
raise UnknownModelTypeError(model=model, available_plugins=list_plugins())
erdantic.exceptions.UnknownModelTypeError: Given model does not match any supported types. Available plugins: ['pydantic', 'pydantic_v1', 'dataclasses']. Model MRO: access_rights=None conforms_to=None contact_point=None
creator=None description=[LiteralField(datatype=None, language=None, value='This is an example data catalog that contains a single dataset.')] has_part=None has_policy=None identifier=None is_referenced_by=None keyword=None landing_page=None license=None language=None relation=None rights=None qualified_relation=None publisher=None release_date=None theme=None title=[LiteralField(datatype=None, language=None, value='Example Data Catalog')] type=None update_date=None qualified_attribution=None has_current_version=None has_version=None previous_version=None replaces=None status=None version=None version_notes=None first=None last=None previous=None distribution=None temporal_coverage=None frequency=None in_series=None spatial=None spatial_resolution=None temporal_resolution=None was_generated_by=None catalog_record=None dataset=[Url('http://example.com/dataset/population')] service=None catalog=None homepage=None themes=None
I looked into the sources and found the inheritance graph: DCATCatalog > DCATDataset > DCATResource > RDFModel > BaseModel. So I expected it to be a pydantic model.
Env info:
Python 3.11.8
SeMPyRO 1.5.0
As a user, I wanted to visualize the
DCATDataSetthat is created here with the visualization code taken from here (please ignore theerdsetup code forPATH):which fails with:
I looked into the sources and found the inheritance graph: DCATCatalog > DCATDataset > DCATResource > RDFModel > BaseModel. So I expected it to be a pydantic model.
Env info:
Python 3.11.8
SeMPyRO 1.5.0