Skip to content

feat(rdf): add RDF materialization for GraphQL schemas #169

Open
mfkaptan-motius wants to merge 9 commits intomainfrom
feat/rdf-materialization
Open

feat(rdf): add RDF materialization for GraphQL schemas #169
mfkaptan-motius wants to merge 9 commits intomainfrom
feat/rdf-materialization

Conversation

@mfkaptan-motius
Copy link
Copy Markdown
Collaborator

@mfkaptan-motius mfkaptan-motius commented Feb 19, 2026

  • Materialize GraphQL SDL to RDF with SKOS and s2dm ontology
  • Support ObjectType, InterfaceType, InputObjectType, UnionType, EnumType
  • Add sorted n-triples serialization and write_rdf_artifacts
  • Add schema-rdf generation to s2dm-publish action
  • Fix graphql locator to accept node modules path optionally
  • Fix registry init command by adding missing working directory arg

closes #79

Copy link
Copy Markdown
Collaborator

@jdacoello jdacoello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SKOS related data should go into one file, and schema related (instantiation of ontology terms) into another file. They both might be used collectively as two separate data graphs within the same SPARQL query.

  • Split the output of the RDF data

Also, the generate command group seems orphaned.
I think one command would be enough

  • s2dm export rdf creates an output/skos.ttl and output/data_graph.ttl
  • Simplify into one rdf command only

@mfkaptan-motius mfkaptan-motius force-pushed the feat/rdf-materialization branch 2 times, most recently from 94ee4b6 to f2778a7 Compare March 19, 2026 13:47
- Materialize GraphQL SDL to RDF with SKOS and s2dm ontology
- Support ObjectType, InterfaceType, InputObjectType, UnionType, EnumType
- Add sorted n-triples serialization and write_rdf_artifacts

Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
- Fix registry init command by adding missing working directory arg

Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
Add SPARQL-based graph traversal for RDF-materialized GraphQL schemas,
enabling declarative querying of schema structure instead of relying
solely on introspection.

- Add `sparql_queries` module with 3 predefined queries:
  fields-outputting-enum, object-types-with-fields, list-type-fields
- Add `s2dm query` CLI command supporting pre-generated RDF files
  and on-the-fly materialization from GraphQL schemas
- Extend `rdf_materializer` with sorted n-triples serialization,
  multi-format output (nt, turtle, json-ld), and format aliases
- Add `print_table` to logger for tabular SPARQL result display
- Update s2dm-publish action to export all RDF formats on release
- Extend CLI and example docs with SPARQL query examples

Closes #77

Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
- Replace `generate schema-rdf` with `export rdf` in CLI docs and examples
- Document output files: skos.{nt,ttl} and data_graph.{nt,ttl}
- Update query examples to use data_graph.nt for SPARQL queries

Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
- Refactor path resolver into generic _PathResolverOption base
- Accept multiple RDF files and URLs via --rdf
- Add builtin SPARQL query registry folder
- Accept custom query files via --query-file

Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
Signed-off-by: Mustafa Kaptan <mustafa.kaptan@motius.de>
@mfkaptan-motius mfkaptan-motius force-pushed the feat/rdf-materialization branch from 19a28c2 to 6dce93b Compare March 24, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate generation of RDF mirror from SDL (unidirectional sync)

2 participants