Skip to content

Jena 6 ont-api#316

Draft
namedgraph wants to merge 12 commits into
developfrom
rf-jena-6-ontapi
Draft

Jena 6 ont-api#316
namedgraph wants to merge 12 commits into
developfrom
rf-jena-6-ontapi

Conversation

@namedgraph

Copy link
Copy Markdown
Member

No description provided.

namedgraph and others added 12 commits June 18, 2026 13:36
- Bump client dependency to 4.3.1-SNAPSHOT (pulls jena-ontapi transitively via Core)
- Migrate 19 vocabularies off the deprecated-for-removal org.apache.jena.ontology API to org.apache.jena.ontapi (OntModelFactory/OntSpecification), with a top-of-class static JenaSystem.init() guard (ontapi NPEs if a vocab class is the first Jena touch)
- Add characterization tests pinning current ontology behavior so the migration can be proven to retain it: imports closure + RDFS materialization, dual-key cache (addDocumentModel), SPARQL-first resolution (OntologyModelGetter), vocab triples

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the dissolution in LinkedDataHub (0 [removal] warnings, was ~90):
- DataManagerImpl -> SameSiteSourceResolver (RDFSourceResolver subclass, same-site restriction)
- OntologyModelGetter -> OntologyRepository (SPARQL-first PrefixGraphRepository subclass)
- DataManagerFactory -> SourceResolverFactory (provides request-scoped RDFSourceResolver)
- Application: per-app OntModelSpec/OntDocumentManager -> per-app OntologyRepository; global repository + resolver; remove PrefixMapper/LocationMapper/OntDocumentManager wiring
- OntologyFilter/ClearOntology: ontapi OntModelFactory.createModel with OWL2_DL_MEM_RDFS_INF + materialize into OWL2_DL_MEM cached in the repository; dual-key import-closure caching preserved
- request ontology property Optional<Ontology> -> Optional<OntModel> (ontapi) across OntologyFactory + ~8 consumers (.getOntModel() dropped)
- Validator, ProxyRequestFilter, ValidatingModelProvider, Install/UninstallPackage: DataManager/OntModelSpec cache ops -> repository
- characterization tests adapted to new API (OntologyRepositoryTest, OntologyFilterTest); 69 tests green

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…api union-graph repository

OntModelFactory.createModel(graph, spec, repository) registers graphs in an OntUnionGraphRepository keyed by ontology ID, which collided with the same graph already in our flat PrefixGraphRepository cache (OntJenaException: 'Another graph with name <...#> is already in the hierarchy', thrown at runtime on the first /ns request).

Replace it with explicit owl:imports closure traversal (loadClosure) that unions the base + imports into one graph, runs RDFS inference over that, and materializes — so createModel is only ever called WITHOUT a repository (no union-hierarchy registration). Encapsulates the duplicated OntologyFilter/ClearOntology load logic into OntologyFilter.loadOntology. OntologyImportsCharacterizationTest now exercises loadOntology and asserts the materialized closure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cognized

GET /ns?forClass=...#Item returned an empty graph: dh:Item is declared 'a rdfs:Class' (dh.ttl), and the ontapi OWL2_DL_MEM profile I'd used does not recognize rdfs:Class as an OntClass, so Namespace's getOntClass(uri) returned null and no SPIN constructor ran. Legacy OntModelSpec.OWL_MEM is OWL 1 Full (recognizes rdfs:Class); the correct ontapi mapping is OWL1_FULL_MEM, not OWL2_DL_MEM. Applied across OntologyFilter pipeline + all vocab holders. OntologyImportsCharacterizationTest now guards getOntClass(rdfs:Class) != null.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
twirl 1.2.0 re-bases the constraint model onto its own SPIN personality, so the ontapi ontology model can be passed straight to SPINConstraints.check; LDH no longer needs to register SPIN into the global personality.

- twirl 1.1.0 -> 1.2.0-SNAPSHOT
- Remove SP.init(BuiltinPersonalities.model) from Application (Web-Client Constructor reads sp:text directly; nothing else needed the global registration)
- Add SPINConstraintValidationTest: guards the Validator path and the raw-ontapi-via-twirl-rebase path

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The document/LDT/ACL ontology classes were declared bare rdfs:Class, which no OWL2 ontapi profile recognizes as an OntClass — forcing OWL1_FULL_MEM (which in turn bans named individuals, breaking SD). Declare them owl:Class (dual with rdfs:Class) and switch all OntSpecification usages from OWL1_FULL_MEM to OWL2_FULL_MEM, so getOntClass/forClass works and named individuals are allowed.

- dh.ttl/ldt.ttl/lacl.ttl: class declarations now 'a rdfs:Class, owl:Class'
- vocab holders + OntologyFilter + ConstructForClass: OWL1_FULL_MEM -> OWL2_FULL_MEM
- remove dead 'import com.atomgraph.client.locator.PrefixMapper' (deleted in Web-Client)
- OntologyImportsCharacterizationTest: assert owl:Class (not rdfs:Class) is recognized

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ns tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OWL2 profiles do not recognise bare rdfs:Class as OntClass, so third-party
vocab terms declared only as rdfs:Class (e.g. sp:Describe in sp.ttl) were
invisible to getOntClass() lookups, returning empty forClass constructor responses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant