Parser
VoID (Vocabulary of Interlinked Datasets) Parser.
Parses an in-memory VoID RDF graph and converts the embedded schema to various downstream formats (JSON-LD, LinkML, SHACL, RDF-config, DataFrame).
- class VoidParser(void_source: str | Graph | None = None, graph_uris: str | list[str] | None = None, exclude_graphs: bool = True)[source]
Bases:
objectParser for VoID (Vocabulary of Interlinked Datasets) files.
Initialize the VoID parser.
- Parameters:
void_source – File path (str) or RDF Graph object
graph_uris – Graph URI(s) to analyze, or None for all non-system graphs
exclude_graphs – Exclude Virtuoso system graphs
- to_jsonld(filter_void_admin_nodes: bool = True, endpoint_url: str | None = None, dataset_name: str | None = None, graph_uris: list[str] | None = None) dict[str, Any][source]
Parse VoID file and return simple JSON-LD with the schema triples.
- Parameters:
filter_void_admin_nodes – Whether to filter out VoID-specific nodes
endpoint_url – SPARQL endpoint URL for the @about section
dataset_name – Dataset name for the @about section
graph_uris – Graph URIs for the @about section
- Returns:
Simple JSON-LD with @context, @graph, and @about sections
- to_schema(filter_void_admin_nodes: bool = True) DataFrame[source]
Parse VoID file and return schema as pandas DataFrame. This method now uses the JSON-LD generation as the source of truth.
- Parameters:
filter_void_admin_nodes – Whether to filter out VoID-specific nodes
- Returns:
DataFrame with schema information including CURIEs
- to_linkml(filter_void_nodes: bool = True, schema_name: str | None = None, schema_description: str | None = None, schema_base_uri: str | None = None, jsonld_override: dict[str, Any] | None = None) SchemaDefinition[source]
Generate LinkML schema from JSON-LD representation.
See
rdfsolve.schema_models.linkml.to_linkml()for full documentation.
- to_linkml_yaml(filter_void_nodes: bool = True, schema_name: str | None = None, schema_description: str | None = None, schema_base_uri: str | None = None) str[source]
Return LinkML schema as YAML string.