Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3a555cc
Initial attempt
multimeric Dec 20, 2024
be9d6e8
Walk upwards from elements
multimeric Dec 20, 2024
5e33d0b
Rewrite to recursive parser
multimeric Dec 20, 2024
582b888
Comment all functions
multimeric Jan 1, 2025
e4153fe
Clean up commented code
multimeric Jan 1, 2025
590bade
Support documentation, annotation and simpleType
multimeric Jan 2, 2025
4b4a890
Tag elements vs attributes using keywords
multimeric Jan 2, 2025
16200a4
Add / to namespace base
multimeric Jan 2, 2025
a6ede0f
Implement simpleType, complexType, simpleContent, complexContent, res…
multimeric Jan 2, 2025
ba58d81
Fix bugs in element handling
multimeric Jan 2, 2025
596ed4a
Use lxml stubs; convert is_a types from XSD
multimeric Jan 3, 2025
51ce0bf
visit_element always returns a slot
multimeric Jan 3, 2025
5ea3fac
Set up test infrastructure
multimeric Jan 3, 2025
1f466b6
Add complex_type test
multimeric Jan 3, 2025
c3c9693
Merge branch 'main' into xsd
sierra-moxon Jan 15, 2025
037e290
PR checks
multimeric Jan 16, 2025
42613f5
Merge branch 'xsd' of github.com:multimeric/schema-automator into xsd
multimeric Jan 16, 2025
cae3e62
Make slots instantiate xsd:element or xsd:attribute, with tests
multimeric Jan 17, 2025
5bd3562
Remove commented code
multimeric Jan 28, 2025
1ac4fa6
Add tests for the root schema element
multimeric Jan 28, 2025
607aab4
Merge branch 'main' of github.com:linkml/schema-automator into xsd
multimeric May 7, 2025
1731abb
Merge branch 'main' of github.com:linkml/schema-automator into xsd
multimeric Nov 21, 2025
3e0f939
Use QName constants for tags
multimeric Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,549 changes: 2,668 additions & 1,881 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ rdflib = "^7.1.1"
jsonasobj2 = "^1.0.4"
deprecation = "^2.1.0"
numpy = "<2.0"
lxml = "^5.3.0"
pydbml = "^1.1.2"
pyyaml = "^6.0.2"
llm = {version = "^0.21", optional = true}
Expand All @@ -68,6 +69,10 @@ sphinx-click = ">=3.1.0"
sphinxcontrib-mermaid = ">=0.9.2"
myst-parser = "*"
jupyter = ">=1.0.0"
lxml-stubs = "^0.5.1"

[tool.poetry.group.llm.dependencies]
llm = ">=0.12"
lxml = ">=4.9.1"
deptry = "^0.23.0"

Expand Down
18 changes: 18 additions & 0 deletions schema_automator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from schema_automator.importers.rdfs_import_engine import RdfsImportEngine
from schema_automator.importers.sql_import_engine import SqlImportEngine
from schema_automator.importers.tabular_import_engine import TableImportEngine
from schema_automator.importers.xsd_import_engine import XsdImportEngine
from schema_automator.utils.schemautils import write_schema
from schema_automator import __version__

Expand Down Expand Up @@ -497,6 +498,23 @@ def import_rdfs(rdfsfile: str, output: str, metamodel_mappings: str, schema_name
schema = sie.convert(rdfsfile, name=schema_name, **args)
write_schema(schema, output)

@main.command()
@click.argument('xsd')
@output_option
@schema_name_option
@click.option('--output', '-o', help="Path to saved yaml schema")
def import_xsd(xsd: str, output: str, **kwargs):
"""
Import an XML Schema Definition Language (XSD) schema to LinkML

Example:

schemauto import-xsd schema.xml -o prov.yaml
"""
engine = XsdImportEngine()
schema = engine.convert(xsd, **kwargs)
write_schema(schema, output)

@main.command()
@click.argument('rdffile')
@output_option
Expand Down
10 changes: 10 additions & 0 deletions schema_automator/importers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
from schema_automator.importers.dosdp_import_engine import DOSDPImportEngine
from schema_automator.importers.frictionless_import_engine import FrictionlessImportEngine
from schema_automator.importers.cadsr_import_engine import CADSRImportEngine
from schema_automator.importers.xsd_import_engine import XsdImportEngine

__all__ = [
'JsonSchemaImportEngine',
'OwlImportEngine',
'DOSDPImportEngine',
'FrictionlessImportEngine',
'CADSRImportEngine',
'XsdImportEngine'
]
Loading