Skip to content

Improved RDF loading options - #1850

Merged
niklasl merged 12 commits into
developfrom
feature/load-rdf-options
Oct 7, 2026
Merged

niklasl merged 12 commits into
developfrom
feature/load-rdf-options

Conversation

@niklasl

@niklasl niklasl commented Oct 5, 2026 •

Copy link
Copy Markdown
Member
  • Support referencing system context in RdfReader.
    This change included:

    • Factor out shared JSON-LD calls to JsonLdShapes
    • Use flatten and compactWithEmbeddedBlanks to ensure normalized result
    • Add example record with some oddities that are normalized by this
    • Write TrigToJsonLdParser in proper java
  • Add whelktool script for loading each RDF file in a nested directory structure

    This can be used to load the SMDB dump, and/or incorporated into DatasetImporter to load it as a dataset (depending on update routine).

  • Add XmlIterParser and example whelktool script

    Useful for loading larger RDF/XML files by iterating on each description. This is a rather idiosyncratic approach, but worth testing (with system librarians) for importing transformed XML (e.g. ONIX).

  • Add rdfDirToJsonLines command to xlimporter (ImporterMain)

    A simple starting point for creating dataset import files. (Could to with parallelization for speed though!)

@olovy olovy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

niklasl added 11 commits October 7, 2026 15:45
Also:
- Factor out shared JSON-LD calls to JsonLdShapes
- Use flatten and compactWithEmbeddedBlanks to ensure normalized result
- Add example record with some oddities that are normalized by this
- Write TrigToJsonLdParser in proper java
Useful for loading larger RDF/XML files by iterating on each
description. This is a rather idiosyncratic approach, but worth testing
(with system librarians) for importing transformed XML.
Also:
- Let reCompact only expand and compact, whereas
  reCompactWithEmbeddedBlanks expands, flattens, compacts, then
  re-embeds blank nodes.
- Let these two be the only public JsonLdShapes functions.
Also:
- Fixes passed format to Jena
- Adjust some class and method access modifiers
- Only re-compact in TrigToJsonLdParser if a context is passed
since re-compaction is performed in a following step.

(Even though parse now only re-compacts if a context is provided, this
is a more clear invocation. Also, previously, expansion happened
unconditionally, resulting in an expanded form, which made the following
context introspection silently do nothing.)
and factor out a complicated piece as checkedSystemShaped.
@niklasl
niklasl force-pushed the feature/load-rdf-options branch from b39bee7 to 1d121ba Compare October 7, 2026 13:55
@niklasl
niklasl merged commit 69807f3 into develop Oct 7, 2026
1 check passed
@niklasl
niklasl deleted the feature/load-rdf-options branch October 7, 2026 15:19
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.

2 participants