diff --git a/.github/workflows/http-tests.yml b/.github/workflows/http-tests.yml index 90ef8da10a..cacf4cc0d4 100644 --- a/.github/workflows/http-tests.yml +++ b/.github/workflows/http-tests.yml @@ -73,7 +73,7 @@ jobs: { - lapp:versioningRepository . + lds:versioningRepository . } diff --git a/AGENTS.md b/AGENTS.md index 5dc36efe08..36aaeb6b9b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -60,4 +60,4 @@ A single instance hosts multiple **dataspaces**, each a subdomain (origin). Each ## Standards -WebID-TLS · SPARQL 1.1 Query & Update · Graph Store Protocol · Linked Data Templates · SHACL · SPIN · RDF (Turtle/RDF-XML/JSON-LD/N-Triples). LDH composes existing W3C/IETF standards; it does not define new wire protocols. +WebID-TLS · SPARQL 1.1 Query & Update · Graph Store Protocol · SHACL · SPIN · RDF (Turtle/RDF-XML/JSON-LD/N-Triples). LDH composes existing W3C/IETF standards; it does not define new wire protocols. diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0897f6a2..078b83b04b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [6.0.0] Bootstrap 2 is gone, and with it the class vocabulary and the `bs2:` template modes application stylesheets were written against. An override of a `bs2:` mode still compiles and never fires, and the Bootstrap classes are backed by no stylesheet, so the page renders unstyled with no diagnostic — hence the major version. +Every namespace LDH defines now lives under `https://w3id.org/atomgraph/linkeddatahub`. The Linked Data Templates namespace is gone — LDH has not been an LDT implementation since the API became the Graph Store Protocol, and the template machinery was dead code — and the ontology that described an "application" now describes a dataspace, the name the rest of the platform has used since 5.1.0. Both are breaking for stored data as well as for stylesheets: every dataspace is typed in the old namespace and every document in the old document-hierarchy one. + ### Migration - Legacy Bootstrap buttons (`btn`, `btn-primary`, `btn-large`, …) become the `ac-btn` intent/appearance/size vocabulary — `ac-btn in-primary ap-solid sz-md` - `$ac:langs` and `$ac:lang` stylesheet parameters become the `ac:langs()` and `ac:langs()[1]` functions; an `xsl:with-param` left behind is silently ignored @@ -9,10 +11,18 @@ Bootstrap 2 is gone, and with it the class vocabulary and the `bs2:` template mo - Stylesheets extending the removed vocabulary can be diffed against `ldh.css`, the one app layer LDH loads over the vendored design kits - The platform stylesheet is `xsl/layout.xsl`; an `xsl:import` of `xsl/bootstrap/2.3.2/layout.xsl` fails to compile - Every `bs2:` mode takes its design-system component name: `bs2:Row` becomes `ldh:BlockRow`, `bs2:Header` `ac:BlockHeader`, `bs2:PropertyList` `ac:PropertyEditor`, `bs2:Form` `ac:ResourceForm`, `bs2:NavBar` `ac:Header`, `bs2:Lookup` `ldh:Combobox`, `ac:ModeList` `ac:ModeSwitcher`, `ldh:LeftSidebar` `ldh:DataspaceDrawer` -- `ldt:base()` becomes `lapp:base()` and the `$ldt:base` parameter goes; the Java `LDT` vocabulary, the `ldt#ontology` `Link` relation and the `ldt:` terms in `config/*.trig` are untouched +- `ldt:base()` becomes `lds:base()` and the `$ldt:base` parameter goes, along with the rest of the `https://www.w3.org/ns/ldt` namespace: the Java `LDT` vocabulary, the bundled `ldt.ttl`, the `rdfs:subClassOf ldt:Application` on the dataspace class, and the dead `ct:`/`c:` sibling namespaces (`lacl:requestAccess` now ranges over `foaf:Document`) +- `ldt:ontology`, `ldt:service` and `ldt:base` become `lds:ontology`, `lds:service` and `lds:base`. A deployment's `config/dataspaces.trig` and `config/system.trig` each need one prefix where they needed two; the `ldt#ontology` and `ldt#base` `Link` relations change with them, so a client reading either reads the new URI +- `dh:` moves off `www.w3.org`: `https://www.w3.org/ns/ldt/document-hierarchy#` becomes `https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#`. Prefix, class names and `DH.java` are unchanged, so only the namespace string moves — but every `dh:Container` and `dh:Item` already in a triplestore is typed in the old one +- `lapp:` becomes `lds:` and `https://w3id.org/atomgraph/linkeddatahub/apps#` becomes `https://w3id.org/atomgraph/linkeddatahub/dataspaces#`; the ontology file is `lds.ttl`. Classes are renamed with it: `lapp:Application` → `lds:Dataspace`, `lapp:EndUserApplication` → `lds:EndUserDataspace`, `lapp:AdminApplication` → `lds:AdminDataspace`, and the three `*Constructor` individuals to match. `lapp:application` — the `Link` relation naming the dataspace a response belongs to — becomes `lds:dataspace` +- `lapp:Dataset`, `lapp:Package` and the remaining properties keep their local names under the new prefix. `lds:prefix` and `lds:versioningRepository`, used in config and read in Java but never declared, are now declared +- `lapp:frontendProxy` is removed, with no replacement under the new prefix — it was read by nothing. The frontend (Varnish) proxy used for cache-invalidation BAN requests has always come from the `ldhc:frontendProxy` servlet parameter, set from `FRONTEND_PROXY` by `platform/entrypoint.sh`; `lds:backendProxy` stays, since a proxied `lds:Dataset` is read through it +- Stylesheet parameters and functions follow the prefix: `$lapp:origin` → `$lds:origin`, `$lapp:Context` → `$lds:Context`, `lapp:origin()` → `lds:origin()`, `lapp:base()` → `lds:base()`, and `lapp:application-description()` → `lds:dataspace-description()`. A stylesheet still declaring `xmlns:lapp` compiles and silently binds nothing +- Java callers move with the model: the `com.atomgraph.linkeddatahub.apps` package is `…dataspaces`, `Application`/`AdminApplication`/`EndUserApplication` are `Dataspace`/`AdminDataspace`/`EndUserDataspace`, `LAPP` is `LDS`, and the `getApplication()`/`getAdminApplication()`/`getEndUserApplication()` accessors are `getDataspace()`/`getAdminDataspace()`/`getEndUserDataspace()` +- **There is no data migration.** An existing deployment re-seeds: its dataspace descriptions and every document in its stores are typed in namespaces this release no longer reads - One `fuseki` service replaces `fuseki-admin` and `fuseki-end-user`, holding an end-user and an admin TDB2 dataset per dataspace, declared in `config/fuseki/config.ttl` and persisted under `fuseki//` - Datasets are named after the dataspace origin with the deployment host dropped and the role appended: `end-user`, `admin`, `northwind-traders.demo.end-user`, … -- An existing deployment moves its two TDB2 directories under the new dataset names, points every `ldt:service` in `config/system.trig` at `http://fuseki:3030//` and merges the two stores' heap and `mem_limit`; `varnish-admin` and `varnish-end-user` stay +- An existing deployment moves its two TDB2 directories under the new dataset names, points every `lds:service` in `config/system.trig` at `http://fuseki:3030//` and merges the two stores' heap and `mem_limit`; `varnish-admin` and `varnish-end-user` stay - Client-side package composition needs the new `sef-compiler` service: a deployment with its own compose file adds it, the platform's `depends_on` on it and the `./sef` bind mount at `/var/www/linkeddatahub/sef` - `SEF_ROOT` and `SEF_COMPILER` are optional; without them packages compose server-side only, as in 5.10.0 - `CLIENT_STYLESHEET` names the client stylesheet the SEF is composed from (default: the platform's `client.xsl`); a deployment bootstrapping its own sets it to that stylesheet's webapp path, which must import the platform's `client.xsl` directly, and its layout prefers `ldh:client-stylesheet()` over its own SEF diff --git a/CLAUDE.md b/CLAUDE.md index 99830026f2..5c4f8bffb0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,7 +67,7 @@ find ./document-hierarchy/ -name '*.sh' -exec bash {} \; ### Key Components -#### Applications (`com.atomgraph.linkeddatahub.apps.model`) +#### Applications (`com.atomgraph.linkeddatahub.dataspaces.model`) - `AdminApplication` - Administrative interface and functions - `EndUserApplication` - Main user-facing application - Applications are data-driven and loaded from RDF datasets @@ -90,14 +90,14 @@ find ./document-hierarchy/ -name '*.sh' -exec bash {} \; #### Service Layer - `ServiceContext` decouples HTTP infrastructure from `Service`, holding dataspace and service metadata separately -- Dataspace metadata and service metadata are split in configuration; types for `lapp:endUserApplication`/`lapp:adminApplication` are inferred on the fly from `system.trig` +- Dataspace metadata and service metadata are split in configuration; the `lds:EndUserDataspace`/`lds:AdminDataspace` types are inferred on the fly from `system.trig` ### Dataspaces Since v5.1.0, a single LDH instance supports multiple **dataspaces**, each identified by a distinct subdomain (origin). Each dataspace is a pair of applications: an end-user app (``) and an admin app (`admin.`), routed by nginx via wildcard subdomain matching. Configuration is split across two files: -- `config/dataspaces.trig` — public metadata: origins (`lapp:origin`), ontologies (`ldt:ontology`), stylesheets (`ac:stylesheet`) -- `config/system.trig` — internal wiring: maps apps to SPARQL services (`ldt:service`) and assigns types (`lapp:AdminApplication`/`lapp:EndUserApplication`) +- `config/dataspaces.trig` — public metadata: origins (`lds:origin`), ontologies (`lds:ontology`), stylesheets (`ac:stylesheet`) +- `config/system.trig` — internal wiring: maps dataspaces to SPARQL services (`lds:service`) and assigns types (`lds:AdminDataspace`/`lds:EndUserDataspace`) Multiple dataspaces can share the same backend SPARQL service. @@ -128,9 +128,9 @@ The current design splits rendering by request origin: - **Client-side rendering**: Saxon-JS receives the raw RDF and applies the same XSLT 3 templates used server-side (shared stylesheet), so proxied resources look almost identical to local ones. Key implementation files: -- `ProxyRequestFilter.java` — intercepts `?uri=` and `lapp:Dataset` proxy requests; HTML bypass; forwards external `Link` headers +- `ProxyRequestFilter.java` — intercepts `?uri=` and `lds:Dataset` proxy requests; HTML bypass; forwards external `Link` headers - `ApplicationFilter.java` — registers external proxy target URI in request context (`AC.uri` property) as authoritative proxy marker -- `ResponseHeadersFilter.java` — skips local-only hypermedia links (`sd:endpoint`, `ldt:ontology`, `ac:stylesheet`) for proxy requests; external ones are forwarded by `ProxyRequestFilter` +- `ResponseHeadersFilter.java` — skips local-only hypermedia links (`sd:endpoint`, `lds:ontology`, `ac:stylesheet`) for proxy requests; external ones are forwarded by `ProxyRequestFilter` - `client.xsl` (`ldh:rdf-document-response`) — receives the RDF proxy response client-side; extracts `sd:endpoint` from `Link` header; stores it in `LinkedDataHub.endpoint` - `functions.xsl` (`sd:endpoint()`) — returns `LinkedDataHub.endpoint` when set (external proxy), otherwise falls back to the local SPARQL endpoint diff --git a/README.md b/README.md index 22489f6d9a..0522cfd065 100644 --- a/README.md +++ b/README.md @@ -159,8 +159,8 @@ The [`ldh` command line interface](#command-line-interface) is attached to every Since version 5.1.0, a single LinkedDataHub instance supports multiple **dataspaces**, each identified by a distinct subdomain (origin). Each dataspace consists of a pair of applications: an end-user app (e.g. `https://northwind-traders.demo.localhost:4443`) and an admin app on the `admin.` subdomain (e.g. `https://admin.northwind-traders.demo.localhost:4443`). Dataspace configuration is split across two files: - - [`config/dataspaces.trig`](https://github.com/AtomGraph/LinkedDataHub/blob/master/config/dataspaces.trig) — public metadata: origins (`lapp:origin`), ontologies, stylesheets - - [`config/system.trig`](https://github.com/AtomGraph/LinkedDataHub/blob/master/config/system.trig) — internal wiring: SPARQL service bindings and application types (`lapp:AdminApplication`/`lapp:EndUserApplication`) + - [`config/dataspaces.trig`](https://github.com/AtomGraph/LinkedDataHub/blob/master/config/dataspaces.trig) — public metadata: origins (`lds:origin`), ontologies, stylesheets + - [`config/system.trig`](https://github.com/AtomGraph/LinkedDataHub/blob/master/config/system.trig) — internal wiring: SPARQL service bindings and dataspace types (`lds:AdminDataspace`/`lds:EndUserDataspace`) To add a new dataspace, add corresponding entries to both files. Relative URIs will be resolved against the base URI configured in the `.env` file. @@ -184,7 +184,7 @@ _:warning: Do not use blank nodes to identify applications or services. We recom ```turtle { - lapp:versioningRepository . + lds:versioningRepository . } diff --git a/bin/add-generic-service.sh b/bin/add-generic-service.sh index 98f0086f11..5877a7d3fc 100755 --- a/bin/add-generic-service.sh +++ b/bin/add-generic-service.sh @@ -134,7 +134,7 @@ else fi turtle+="@prefix ldh: .\n" -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix a: .\n" turtle+="@prefix dct: .\n" turtle+="@prefix foaf: .\n" diff --git a/bin/admin/acl/create-authorization.sh b/bin/admin/acl/create-authorization.sh index eb10a21ef4..09dcc7863d 100755 --- a/bin/admin/acl/create-authorization.sh +++ b/bin/admin/acl/create-authorization.sh @@ -192,7 +192,7 @@ if [ -n "$proxy" ]; then args+=("$proxy") fi -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix rdfs: .\n" turtle+="@prefix acl: .\n" turtle+="@prefix dct: .\n" diff --git a/bin/admin/acl/create-group.sh b/bin/admin/acl/create-group.sh index c283f8e0ad..9ab9367406 100755 --- a/bin/admin/acl/create-group.sh +++ b/bin/admin/acl/create-group.sh @@ -136,7 +136,7 @@ if [ -n "$proxy" ]; then args+=("$proxy") fi -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix dct: .\n" turtle+="@prefix foaf: .\n" turtle+="${group} a foaf:Group .\n" diff --git a/bin/admin/acl/make-public.sh b/bin/admin/acl/make-public.sh index c0f5d39c82..7af12a54ab 100755 --- a/bin/admin/acl/make-public.sh +++ b/bin/admin/acl/make-public.sh @@ -84,7 +84,7 @@ BASE <${admin_base}> PREFIX acl: PREFIX def: -PREFIX dh: +PREFIX dh: PREFIX nfo: PREFIX foaf: diff --git a/bin/admin/ontologies/add-class.sh b/bin/admin/ontologies/add-class.sh index b729e988af..030a95e635 100755 --- a/bin/admin/ontologies/add-class.sh +++ b/bin/admin/ontologies/add-class.sh @@ -131,10 +131,9 @@ if [ -n "$proxy" ]; then args+=("$proxy") fi -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix owl: .\n" turtle+="@prefix rdfs: .\n" -turtle+="@prefix ldt: .\n" turtle+="@prefix dct: .\n" turtle+="@prefix foaf: .\n" turtle+="@prefix spin: .\n" diff --git a/bin/admin/ontologies/create-ontology.sh b/bin/admin/ontologies/create-ontology.sh index c0a8e2df6f..051923c6fd 100755 --- a/bin/admin/ontologies/create-ontology.sh +++ b/bin/admin/ontologies/create-ontology.sh @@ -126,7 +126,7 @@ if [ -n "$proxy" ]; then args+=("$proxy") fi -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix owl: .\n" turtle+="@prefix rdfs: .\n" turtle+="@prefix dct: .\n" diff --git a/bin/admin/ontologies/import-ontology.sh b/bin/admin/ontologies/import-ontology.sh index 5a22efb513..863bee6c6c 100755 --- a/bin/admin/ontologies/import-ontology.sh +++ b/bin/admin/ontologies/import-ontology.sh @@ -122,7 +122,7 @@ if [ -n "$proxy" ]; then scratch_url="${scratch/$base_host/$proxy_host}" fi -printf '@prefix dh:\t .\n@prefix dct:\t .\n<%s> a dh:Item ;\n dct:title "Import ontology scratch" .\n' "$scratch" \ +printf '@prefix dh:\t .\n@prefix dct:\t .\n<%s> a dh:Item ;\n dct:title "Import ontology scratch" .\n' "$scratch" \ | curl -f -s -k -o /dev/null \ -E "$cert_pem_file":"$cert_password" \ -X PUT --data-binary @- \ diff --git a/bin/create-container.sh b/bin/create-container.sh index f6801305a3..260d1b6931 100755 --- a/bin/create-container.sh +++ b/bin/create-container.sh @@ -122,7 +122,7 @@ args+=("-t") args+=("text/turtle") args+=("$target") -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="@prefix ldh: .\n" turtle+="@prefix rdf: .\n" turtle+="@prefix dct: .\n" diff --git a/bin/create-item.sh b/bin/create-item.sh index b5470eb650..86d36e0125 100755 --- a/bin/create-item.sh +++ b/bin/create-item.sh @@ -112,7 +112,7 @@ args+=("text/turtle") args+=("${target}") turtle+="@prefix dct: .\n" -turtle+="@prefix dh: .\n" +turtle+="@prefix dh: .\n" turtle+="<${target}> a dh:Item .\n" turtle+="<${target}> dct:title \"${title}\" .\n" diff --git a/cli/src/main/java/com/atomgraph/linkeddatahub/cli/sparql/Updates.java b/cli/src/main/java/com/atomgraph/linkeddatahub/cli/sparql/Updates.java index 9566edf7bf..160cb6bb6e 100644 --- a/cli/src/main/java/com/atomgraph/linkeddatahub/cli/sparql/Updates.java +++ b/cli/src/main/java/com/atomgraph/linkeddatahub/cli/sparql/Updates.java @@ -67,12 +67,12 @@ public static String insertPackageImport(URI packageURI) { ParameterizedSparqlString pss = new ParameterizedSparqlString(""" PREFIX ldh: - PREFIX lapp: + PREFIX lds: INSERT { ?app ldh:import ?package . } WHERE { - ?app a lapp:Application . + ?app a lds:Dataspace . } """); pss.setIri("package", packageURI.toString()); @@ -170,7 +170,7 @@ public static String makePublic(URI base, URI adminBase) ParameterizedSparqlString pss = new ParameterizedSparqlString(""" PREFIX acl: PREFIX def: - PREFIX dh: + PREFIX dh: PREFIX nfo: PREFIX foaf: diff --git a/cli/src/main/java/com/atomgraph/linkeddatahub/cli/vocab/DH.java b/cli/src/main/java/com/atomgraph/linkeddatahub/cli/vocab/DH.java index 5829aae8e4..dcc80f8036 100644 --- a/cli/src/main/java/com/atomgraph/linkeddatahub/cli/vocab/DH.java +++ b/cli/src/main/java/com/atomgraph/linkeddatahub/cli/vocab/DH.java @@ -28,7 +28,7 @@ public final class DH { /** Namespace URI */ - public static final String NS = "https://www.w3.org/ns/ldt/document-hierarchy#"; + public static final String NS = "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#"; private DH() { } diff --git a/cli/src/test/java/com/atomgraph/linkeddatahub/cli/command/ModelBuildersTest.java b/cli/src/test/java/com/atomgraph/linkeddatahub/cli/command/ModelBuildersTest.java index d734c449ea..770dd454cc 100644 --- a/cli/src/test/java/com/atomgraph/linkeddatahub/cli/command/ModelBuildersTest.java +++ b/cli/src/test/java/com/atomgraph/linkeddatahub/cli/command/ModelBuildersTest.java @@ -49,7 +49,7 @@ public class ModelBuildersTest private static final URI TARGET = URI.create("https://localhost:4443/some/"); private static final String PREFIXES = """ - @prefix dh: . + @prefix dh: . @prefix ldh: . @prefix rdf: . @prefix dct: . diff --git a/cli/src/test/java/com/atomgraph/linkeddatahub/cli/http/HttpExceptionTest.java b/cli/src/test/java/com/atomgraph/linkeddatahub/cli/http/HttpExceptionTest.java index 73b62e5bb0..22990f82b2 100644 --- a/cli/src/test/java/com/atomgraph/linkeddatahub/cli/http/HttpExceptionTest.java +++ b/cli/src/test/java/com/atomgraph/linkeddatahub/cli/http/HttpExceptionTest.java @@ -46,7 +46,7 @@ public void passesThroughSuccessStatus() throws Exception { try (StubServer server = new StubServer()) { - server.responds(200, " a ."); + server.responds(200, " a ."); URI target = server.baseURI().resolve("some/"); try (Response response = HttpException.check(target, client().get(target, ACCEPT_TURTLE))) diff --git a/config/dataspaces.trig b/config/dataspaces.trig index 12c44d8a61..9e505adba4 100644 --- a/config/dataspaces.trig +++ b/config/dataspaces.trig @@ -1,6 +1,5 @@ -@prefix lapp: . +@prefix lds: . @prefix ac: . -@prefix ldt: . @prefix dct: . ### do not use blank nodes to identify resources! ### @@ -10,10 +9,10 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "LinkedDataHub admin" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet . } @@ -22,12 +21,12 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "LinkedDataHub" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet ; - lapp:public true . + lds:public true . } @@ -35,10 +34,10 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "Northwind Traders admin" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet . } @@ -47,11 +46,11 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "Northwind Traders" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet ; - lapp:public true . + lds:public true . } diff --git a/config/system.trig b/config/system.trig index 9ad9173247..565733dbda 100644 --- a/config/system.trig +++ b/config/system.trig @@ -1,6 +1,5 @@ -@prefix lapp: . +@prefix lds: . @prefix a: . -@prefix ldt: . @prefix sd: . @prefix dct: . @prefix doap: . @@ -13,8 +12,8 @@ { - a lapp:AdminApplication ; - ldt:service . + a lds:AdminDataspace ; + lds:service . } # root admin - service description @@ -33,11 +32,11 @@ { - a lapp:EndUserApplication ; - ldt:service . + a lds:EndUserDataspace ; + lds:service . # uncomment to enable GitHub-backed graph versioning for this dataspace: - # lapp:versioningRepository . + # lds:versioningRepository . } # root end-user - versioning repository (GitHub-backed graph versioning) @@ -68,8 +67,8 @@ { - a lapp:AdminApplication ; - ldt:service . + a lds:AdminDataspace ; + lds:service . } # northwind-traders admin - service description @@ -88,8 +87,8 @@ { - a lapp:EndUserApplication ; - ldt:service . + a lds:EndUserDataspace ; + lds:service . } # northwind-traders end-user - service description diff --git a/http-tests/access/POST-request-access.sh b/http-tests/access/POST-request-access.sh index ea2c706af0..0a8dfe2009 100755 --- a/http-tests/access/POST-request-access.sh +++ b/http-tests/access/POST-request-access.sh @@ -23,8 +23,8 @@ curl -w "%{http_code}\n" -o /dev/null -k -s \ --data-urlencode "ou=${END_USER_BASE_URL}sparql" \ --data-urlencode "pu=http://www.w3.org/ns/auth/acl#accessToClass" \ --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/default#Root" \ - --data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Container" \ - --data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Item" \ + --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Container" \ + --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item" \ --data-urlencode "ou=http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject" \ --data-urlencode "pu=http://www.w3.org/ns/auth/acl#mode" \ --data-urlencode "ou=http://www.w3.org/ns/auth/acl#Read" \ diff --git a/http-tests/add/PUT-generate-container.sh b/http-tests/add/PUT-generate-container.sh index 21451dddef..86ecb74e75 100755 --- a/http-tests/add/PUT-generate-container.sh +++ b/http-tests/add/PUT-generate-container.sh @@ -27,7 +27,7 @@ ldh admin add agent \ parent="$END_USER_BASE_URL" uuid=$(uuidgen | tr '[:upper:]' '[:lower:]') container="${parent}${uuid}/" -class="https://www.w3.org/ns/ldt/document-hierarchy#Container" +class="https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Container" # PUT the generated container document (blank nodes are skolemized server-side) @@ -37,9 +37,9 @@ http_code=$(curl -k -s -o /dev/null -w "%{http_code}" \ -H "Content-Type: application/rdf+xml" \ --data-binary @- \ "$container" < + - + Containers ${uuid} diff --git a/http-tests/admin/acl/add-delete-class-authorization.sh b/http-tests/admin/acl/add-delete-class-authorization.sh index ea59a018e0..38d3343051 100755 --- a/http-tests/admin/acl/add-delete-class-authorization.sh +++ b/http-tests/admin/acl/add-delete-class-authorization.sh @@ -38,7 +38,7 @@ ldh admin create authorization \ -b "https://admin.test.localhost:4443/" \ --label "Fake DELETE class authorization from test.localhost" \ --agent "$AGENT_URI" \ - --to-all-in "https://www.w3.org/ns/ldt/document-hierarchy#Container" \ + --to-all-in "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Container" \ --write # access is still denied (fake authorization filtered out) @@ -58,7 +58,7 @@ ldh admin create authorization \ -b "$ADMIN_BASE_URL" \ --label "DELETE authorization" \ --agent "$AGENT_URI" \ - --to-all-in "https://www.w3.org/ns/ldt/document-hierarchy#Container" \ + --to-all-in "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Container" \ --write # access is allowed after real authorization is created diff --git a/http-tests/admin/model/add-class.sh b/http-tests/admin/model/add-class.sh index 2b7d6fe8d5..2cb83ff1d4 100755 --- a/http-tests/admin/model/add-class.sh +++ b/http-tests/admin/model/add-class.sh @@ -22,7 +22,7 @@ ldh admin add class \ -b "$ADMIN_BASE_URL" \ --uri "$class" \ --label "New class" \ - --sub-class-of "https://www.w3.org/ns/ldt/document-hierarchy#Item" \ + --sub-class-of "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item" \ "$ontology_doc" # clear ontology from memory diff --git a/http-tests/admin/model/add-property-constraint.sh b/http-tests/admin/model/add-property-constraint.sh index 0207415eae..dfeb0452ee 100755 --- a/http-tests/admin/model/add-property-constraint.sh +++ b/http-tests/admin/model/add-property-constraint.sh @@ -34,7 +34,7 @@ ldh admin add class \ --uri "${namespace_doc}#ConstrainedClass" \ --label "Constrained class" \ --constraint "$constraint" \ - --sub-class-of "https://www.w3.org/ns/ldt/document-hierarchy#Item" \ + --sub-class-of "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item" \ "$ontology_doc" # clear ontology from memory diff --git a/http-tests/config/dataspaces.trig b/http-tests/config/dataspaces.trig index bede0dd54d..ab616a3662 100644 --- a/http-tests/config/dataspaces.trig +++ b/http-tests/config/dataspaces.trig @@ -1,10 +1,9 @@ -@prefix lapp: . +@prefix lds: . @prefix ldh: . @prefix ac: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . -@prefix ldt: . @prefix dct: . @prefix foaf: . @@ -15,10 +14,10 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "LinkedDataHub admin" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet . } @@ -26,22 +25,22 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "LinkedDataHub" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet ; - lapp:public true . + lds:public true . } # test admin { - a lapp:Application ; + a lds:Dataspace ; dct:title "Test admin" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet . } @@ -49,10 +48,10 @@ { - a lapp:Application ; + a lds:Dataspace ; dct:title "Test" ; - lapp:origin ; - ldt:ontology ; + lds:origin ; + lds:ontology ; ac:stylesheet ; - lapp:public true . + lds:public true . } diff --git a/http-tests/config/system.trig b/http-tests/config/system.trig index 4a08ed2c0a..25f6cc9264 100644 --- a/http-tests/config/system.trig +++ b/http-tests/config/system.trig @@ -1,7 +1,6 @@ -@prefix lapp: . +@prefix lds: . @prefix a: . @prefix rdf: . -@prefix ldt: . @prefix sd: . @prefix dct: . @@ -12,8 +11,8 @@ { - a lapp:AdminApplication ; - ldt:service . + a lds:AdminDataspace ; + lds:service . } # root admin - service description @@ -32,8 +31,8 @@ { - a lapp:EndUserApplication ; - ldt:service . + a lds:EndUserDataspace ; + lds:service . } # root end-user - service description @@ -52,8 +51,8 @@ { - a lapp:AdminApplication ; - ldt:service . + a lds:AdminDataspace ; + lds:service . } # test admin - service description @@ -72,8 +71,8 @@ { - a lapp:EndUserApplication ; - ldt:service . + a lds:EndUserDataspace ; + lds:service . } # test end-user - service description diff --git a/http-tests/document-hierarchy/PUT-content-blocks.sh b/http-tests/document-hierarchy/PUT-content-blocks.sh index 549dcd13f0..3e496b27cf 100755 --- a/http-tests/document-hierarchy/PUT-content-blocks.sh +++ b/http-tests/document-hierarchy/PUT-content-blocks.sh @@ -41,7 +41,7 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$item" < . +<${item}> . <${item}> "Test item" . <${item}> <${END_USER_BASE_URL}> . <${item}> <${item}#obj> . diff --git a/http-tests/document-hierarchy/PUT-if-none-match.sh b/http-tests/document-hierarchy/PUT-if-none-match.sh index 489f2176b5..26340fabe2 100755 --- a/http-tests/document-hierarchy/PUT-if-none-match.sh +++ b/http-tests/document-hierarchy/PUT-if-none-match.sh @@ -27,7 +27,7 @@ ldh admin add agent \ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]') document="${END_USER_BASE_URL}${uuid}/" -body="<${document}> . +body="<${document}> . <${document}> \"Conditional create\" ." # the document does not exist yet: creating it needs no validator, and If-None-Match: * is satisfied diff --git a/http-tests/document-hierarchy/PUT-invalid-content-block-422.sh b/http-tests/document-hierarchy/PUT-invalid-content-block-422.sh index 4158e63ae1..3dc58de105 100755 --- a/http-tests/document-hierarchy/PUT-invalid-content-block-422.sh +++ b/http-tests/document-hierarchy/PUT-invalid-content-block-422.sh @@ -40,7 +40,7 @@ response=$(curl -k -w "%{http_code}\n" -s \ -H "Content-Type: application/n-triples" \ --data-binary @- \ "$item" < . +<${item}> . <${item}> "Test item" . <${item}> <${END_USER_BASE_URL}> . <${item}> <${item}#bad-block> . diff --git a/http-tests/document-hierarchy/PUT-item-metadata.sh b/http-tests/document-hierarchy/PUT-item-metadata.sh index 1d1ca0ba8d..8b69277e0d 100755 --- a/http-tests/document-hierarchy/PUT-item-metadata.sh +++ b/http-tests/document-hierarchy/PUT-item-metadata.sh @@ -45,7 +45,7 @@ item_ntriples=$(ldh get \ # check that the default RDF type was assigned to the new document -echo "$item_ntriples" | grep "<${item}> " +echo "$item_ntriples" | grep "<${item}> " # check that sioc:has_container was assigned to the new document @@ -71,7 +71,7 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \ --data-binary @- \ "$item" < "named object PUT" . -<${item}> . +<${item}> . <${item}> "Title" . EOF ) \ @@ -86,7 +86,7 @@ item_ntriples=$(ldh get \ # check that the default RDF type is still assigned to the document -echo "$item_ntriples" | grep "<${item}> " +echo "$item_ntriples" | grep "<${item}> " # check that sioc:has_container is still assigned to the document diff --git a/http-tests/document-hierarchy/PUT-no-slash-308.sh b/http-tests/document-hierarchy/PUT-no-slash-308.sh index d738bc431d..c44543b157 100755 --- a/http-tests/document-hierarchy/PUT-no-slash-308.sh +++ b/http-tests/document-hierarchy/PUT-no-slash-308.sh @@ -69,4 +69,4 @@ curl -k -G \ "$item" \ | tr -d '\n' \ | grep '"named object PUT"' \ -| grep "<${item}> " +| grep "<${item}> " diff --git a/http-tests/document-hierarchy/PUT-orphan-bnode-object-skolemized.sh b/http-tests/document-hierarchy/PUT-orphan-bnode-object-skolemized.sh index 60b78fb427..5611beddde 100755 --- a/http-tests/document-hierarchy/PUT-orphan-bnode-object-skolemized.sh +++ b/http-tests/document-hierarchy/PUT-orphan-bnode-object-skolemized.sh @@ -43,7 +43,7 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$container" < . +<${container}> . <${container}> "Test container" . <${container}> <${END_USER_BASE_URL}> . <${container}> _:orphan . diff --git a/http-tests/document-hierarchy/PUT-relative-uri-turtle.sh b/http-tests/document-hierarchy/PUT-relative-uri-turtle.sh index 522d0de096..ad7c70b19a 100755 --- a/http-tests/document-hierarchy/PUT-relative-uri-turtle.sh +++ b/http-tests/document-hierarchy/PUT-relative-uri-turtle.sh @@ -49,7 +49,7 @@ response=$(curl -k -f -G -s \ "$item") for triple in \ - "<${item}> " \ + "<${item}> " \ "<${item}named-subject-put> \"named object PUT\" ." do if ! grep -qF "$triple" <<< "$response"; then diff --git a/http-tests/federation/GET-remote-document-links.sh b/http-tests/federation/GET-remote-document-links.sh index 198bb04481..242deaecd9 100755 --- a/http-tests/federation/GET-remote-document-links.sh +++ b/http-tests/federation/GET-remote-document-links.sh @@ -35,7 +35,7 @@ grep -i '^link:' "$headers" | tr ',' '\n' | grep 'sparql-service-description#end # B's application URI is forwarded too (it marks the remote as a Linked Data application) -grep -i '^link:' "$headers" | tr ',' '\n' | grep -q 'linkeddatahub/apps#application' +grep -i '^link:' "$headers" | tr ',' '\n' | grep -q 'linkeddatahub/dataspaces#dataspace' # the proxied response carries B's own ETag (resource-state validator), enabling If-Match writes diff --git a/http-tests/federation/POST-remote-ns-constructors.sh b/http-tests/federation/POST-remote-ns-constructors.sh index 4201b0699e..606294488b 100755 --- a/http-tests/federation/POST-remote-ns-constructors.sh +++ b/http-tests/federation/POST-remote-ns-constructors.sh @@ -11,13 +11,13 @@ clear_ontology # Federation ontology leg: the constructor SELECT that drives A's client-side form derivation, # posed against B's ns endpoint through A's proxy. On a remote pane the client resolves ns -# against the pane's data-base (B's base from the forwarded lapp:application Link), so forms +# against the pane's data-base (B's base from the forwarded lds:dataspace Link), so forms # for B's resources derive from B's ontology closure - this pins that contract on the wire. remote_base="https://test.localhost:4443/" remote_ns="${remote_base}ns" -query='SELECT DISTINCT ?constructor ?text WHERE { VALUES ?type { } ?type * ?class . ?class ?constructor . ?constructor ?text . }' +query='SELECT DISTINCT ?constructor ?text WHERE { VALUES ?type { } ?type * ?class . ?class ?constructor . ?constructor ?text . }' results=$(curl -k -f -s \ -X POST \ diff --git a/http-tests/imports/csv-test.rq b/http-tests/imports/csv-test.rq index cd0053fdbb..7271d46a44 100644 --- a/http-tests/imports/csv-test.rq +++ b/http-tests/imports/csv-test.rq @@ -1,7 +1,7 @@ PREFIX dct: PREFIX xsd: PREFIX rdf: -PREFIX dh: +PREFIX dh: PREFIX sioc: CONSTRUCT diff --git a/http-tests/imports/rdf-service-internal.rq b/http-tests/imports/rdf-service-internal.rq index c3c0a49064..998c04a0de 100644 --- a/http-tests/imports/rdf-service-internal.rq +++ b/http-tests/imports/rdf-service-internal.rq @@ -1,4 +1,4 @@ -PREFIX dh: +PREFIX dh: PREFIX sioc: PREFIX dct: diff --git a/http-tests/imports/rdf-test.rq b/http-tests/imports/rdf-test.rq index 3da70a67df..8796503d59 100644 --- a/http-tests/imports/rdf-test.rq +++ b/http-tests/imports/rdf-test.rq @@ -1,4 +1,4 @@ -PREFIX dh: +PREFIX dh: PREFIX sioc: PREFIX foaf: PREFIX skos: diff --git a/http-tests/language/literal-lang-attributes.sh b/http-tests/language/literal-lang-attributes.sh index 4a3b0cebc7..e195e59393 100755 --- a/http-tests/language/literal-lang-attributes.sh +++ b/http-tests/language/literal-lang-attributes.sh @@ -21,7 +21,7 @@ doc_url="${END_USER_BASE_URL}${slug}/" # the properties belong to the document's primary topic: a document describing nothing but itself renders its title and # an empty body, so the values would never reach a dd -echo "<${doc_url}> . +echo "<${doc_url}> . <${doc_url}> \"Language marking\" . <${doc_url}> <${doc_url}#this> . <${doc_url}#this> . diff --git a/http-tests/misc/GET-settings.sh b/http-tests/misc/GET-settings.sh index a5df72362d..dc422ae4f1 100755 --- a/http-tests/misc/GET-settings.sh +++ b/http-tests/misc/GET-settings.sh @@ -30,7 +30,7 @@ if ! echo "$body" | grep -q ''; then exit 1 fi -if ! echo "$body" | grep -q ''; then +if ! echo "$body" | grep -q ''; then exit 1 fi diff --git a/http-tests/misc/PATCH-settings-422.sh b/http-tests/misc/PATCH-settings-422.sh index aa2347e3c5..fbf6295cbc 100755 --- a/http-tests/misc/PATCH-settings-422.sh +++ b/http-tests/misc/PATCH-settings-422.sh @@ -15,8 +15,8 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \ -X PATCH \ -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ -H "Content-Type: application/sparql-update" \ - -d "PREFIX lapp: -DELETE { ?app lapp:origin ?origin } -WHERE { ?app lapp:origin ?origin }" \ + -d "PREFIX lds: +DELETE { ?app lds:origin ?origin } +WHERE { ?app lds:origin ?origin }" \ "${END_USER_BASE_URL}settings" \ | grep -q "$STATUS_UNPROCESSABLE_ENTITY" diff --git a/http-tests/misc/PATCH-settings-package-containment.sh b/http-tests/misc/PATCH-settings-package-containment.sh index 0156c63963..2a69898185 100755 --- a/http-tests/misc/PATCH-settings-package-containment.sh +++ b/http-tests/misc/PATCH-settings-package-containment.sh @@ -21,7 +21,7 @@ clear_ontology # probe document's topic must carry that marker with the import and not without. The property list # belongs to the described resource, so the probe document names a topic with a title. # -# The package lives on the instance itself: a document describing a lapp:Package whose ac:stylesheet is +# The package lives on the instance itself: a document describing a lds:Package whose ac:stylesheet is # an uploaded file. Both are fetched by the server through its own origin, the way an uploaded ontology # is (admin/model/ontology-import-upload-no-deadlock.sh). @@ -116,7 +116,7 @@ function remove_import() trap remove_import EXIT -# the package description: a document whose primary topic is the lapp:Package, naming the uploaded +# the package description: a document whose primary topic is the lds:Package, naming the uploaded # stylesheet - the upload URI is content-addressed, so it is known before the file is uploaded curl -k -w "%{http_code}\n" -o /dev/null -f -s \ @@ -126,11 +126,11 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$package_doc" < . +<${package_doc}> . <${package_doc}> "Containment probe package" . <${package_doc}> <${END_USER_BASE_URL}> . <${package_doc}> <${package_uri}> . -<${package_uri}> . +<${package_uri}> . <${package_uri}> "Containment probe package" . <${package_uri}> <${stylesheet_uri}> . EOT @@ -160,7 +160,7 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$probe_doc" < . +<${probe_doc}> . <${probe_doc}> "Containment probe" . <${probe_doc}> <${END_USER_BASE_URL}> . <${probe_doc}> <${probe_doc}#this> . diff --git a/http-tests/misc/PATCH-settings-package-import.sh b/http-tests/misc/PATCH-settings-package-import.sh index ace3da444f..74e6350b2c 100755 --- a/http-tests/misc/PATCH-settings-package-import.sh +++ b/http-tests/misc/PATCH-settings-package-import.sh @@ -111,7 +111,7 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$doc" < . +<${doc}> . <${doc}> "Taxonomy editor package probe" . <${doc}> <${END_USER_BASE_URL}> . <${doc}> <${concept}> . diff --git a/http-tests/misc/PATCH-settings-package-same-origin-no-deadlock.sh b/http-tests/misc/PATCH-settings-package-same-origin-no-deadlock.sh index 827cb210db..1eb71ae4a5 100755 --- a/http-tests/misc/PATCH-settings-package-same-origin-no-deadlock.sh +++ b/http-tests/misc/PATCH-settings-package-same-origin-no-deadlock.sh @@ -64,11 +64,11 @@ curl -k -w "%{http_code}\n" -o /dev/null -f -s \ --data-binary @- \ "$package_doc" < . +<${package_doc}> . <${package_doc}> "Same-origin package" . <${package_doc}> <${END_USER_BASE_URL}> . <${package_doc}> <${package_uri}> . -<${package_uri}> . +<${package_uri}> . <${package_uri}> "Same-origin package" . <${package_uri}> <${stylesheet_uri}> . EOT diff --git a/http-tests/push/app/a.ttl b/http-tests/push/app/a.ttl index 129d6cd8b6..7062127d76 100644 --- a/http-tests/push/app/a.ttl +++ b/http-tests/push/app/a.ttl @@ -1,4 +1,4 @@ -@prefix dh: . +@prefix dh: . @prefix ldh: . @prefix dct: . @prefix rdf: . diff --git a/http-tests/push/app/a/b.ttl b/http-tests/push/app/a/b.ttl index 3c1437dd19..fc42f786ba 100644 --- a/http-tests/push/app/a/b.ttl +++ b/http-tests/push/app/a/b.ttl @@ -1,4 +1,4 @@ -@prefix dh: . +@prefix dh: . @prefix dct: . <> a dh:Item ; diff --git a/http-tests/push/app/a/c.ttl b/http-tests/push/app/a/c.ttl index 9f1c6d561b..e23ab58093 100644 --- a/http-tests/push/app/a/c.ttl +++ b/http-tests/push/app/a/c.ttl @@ -1,4 +1,4 @@ -@prefix dh: . +@prefix dh: . @prefix dct: . # listed in a/.ldhignore, so never pushed diff --git a/http-tests/push/app/root.ttl b/http-tests/push/app/root.ttl index c9d4af52e2..c841709e82 100644 --- a/http-tests/push/app/root.ttl +++ b/http-tests/push/app/root.ttl @@ -1,4 +1,4 @@ -@prefix dh: . +@prefix dh: . @prefix ldh: . @prefix dct: . @prefix rdf: . diff --git a/http-tests/rdfa/graph-in-markup.sh b/http-tests/rdfa/graph-in-markup.sh index 150e140547..3345c3e00d 100755 --- a/http-tests/rdfa/graph-in-markup.sh +++ b/http-tests/rdfa/graph-in-markup.sh @@ -21,7 +21,7 @@ clear_ontology slug=$(uuidgen | tr '[:upper:]' '[:lower:]') doc_url="${END_USER_BASE_URL}${slug}/" -echo "<${doc_url}> . +echo "<${doc_url}> . <${doc_url}> \"Graph in markup\" . <${doc_url}> <${doc_url}#this> . <${doc_url}#this> . @@ -70,7 +70,7 @@ count() # the document describes itself: what the chrome shows and what it omits are both asserted [ "$(count "//*[@property = 'http://purl.org/dc/terms/title'][@content = 'Graph in markup']")" -ge "1" ] -[ "$(count "//*[@property = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][@resource = 'https://www.w3.org/ns/ldt/document-hierarchy#Item']")" -ge "1" ] +[ "$(count "//*[@property = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][@resource = 'https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item']")" -ge "1" ] [ "$(count "//*[@property = 'http://xmlns.com/foaf/0.1/primaryTopic'][@resource = '${doc_url}#this']")" -ge "1" ] # the RDFa default subject is the document, not the request URI - otherwise every head-level assertion moves to a diff --git a/http-tests/root-owner.trig.template b/http-tests/root-owner.trig.template index d16aef5ac6..c877c8e629 100644 --- a/http-tests/root-owner.trig.template +++ b/http-tests/root-owner.trig.template @@ -2,7 +2,7 @@ @prefix xsd: . @prefix acl: . @prefix cert: . -@prefix dh: . +@prefix dh: . @prefix sioc: . @prefix foaf: . @prefix dct: . diff --git a/http-tests/signup.sh b/http-tests/signup.sh index d4ca5ff983..ffa05e2044 100755 --- a/http-tests/signup.sh +++ b/http-tests/signup.sh @@ -36,7 +36,7 @@ curl -k -s -f \ --data-urlencode "sb=agent" \ --data-urlencode "sb=doc" \ --data-urlencode "pu=http://www.w3.org/1999/02/22-rdf-syntax-ns#type" \ - --data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Item" \ + --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item" \ --data-urlencode "pu=http://purl.org/dc/terms/description" \ --data-urlencode "lt=http://www.w3.org/2001/XMLSchema#string" \ --data-urlencode "pu=http://rdfs.org/sioc/ns#has_container" \ @@ -44,7 +44,7 @@ curl -k -s -f \ --data-urlencode "pu=http://purl.org/dc/terms/title" \ --data-urlencode "ol=${title}" \ --data-urlencode "lt=http://www.w3.org/2001/XMLSchema#string" \ - --data-urlencode "pu=https://www.w3.org/ns/ldt/document-hierarchy#slug" \ + --data-urlencode "pu=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#slug" \ --data-urlencode "ol=${uuid}" \ --data-urlencode "pu=http://xmlns.com/foaf/0.1/primaryTopic" \ --data-urlencode "ob=agent" \ diff --git a/http-tests/sparql-protocol/query/GET-ns-constructors.sh b/http-tests/sparql-protocol/query/GET-ns-constructors.sh index 748fd8f321..3edeadccf1 100755 --- a/http-tests/sparql-protocol/query/GET-ns-constructors.sh +++ b/http-tests/sparql-protocol/query/GET-ns-constructors.sh @@ -12,7 +12,7 @@ clear_ontology # the constructor SELECT the client-side instantiation relies on: for a type set it returns the # spin:constructor texts of the classes and their superclasses, deduplicated -query='SELECT DISTINCT ?constructor ?text WHERE { VALUES ?type { } ?type * ?class . ?class ?constructor . ?constructor ?text . }' +query='SELECT DISTINCT ?constructor ?text WHERE { VALUES ?type { } ?type * ?class . ?class ?constructor . ?constructor ?text . }' results=$(curl -k -f -s -G \ -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ @@ -21,9 +21,9 @@ results=$(curl -k -f -s -G \ --data-urlencode "query=${query}") # the end-user app class's own constructor is returned -echo "$results" | grep -q "https://w3id.org/atomgraph/linkeddatahub/apps#EndUserApplicationConstructor" +echo "$results" | grep -q "https://w3id.org/atomgraph/linkeddatahub/dataspaces#EndUserDataspaceConstructor" -# the generic constructors attached to lapp:Application by the default ontology are returned +# the generic constructors attached to lds:Dataspace by the default ontology are returned echo "$results" | grep -q "https://w3id.org/atomgraph/linkeddatahub#TitleConstructor" # the constructor texts are returned (CONSTRUCT templates the client instantiates) diff --git a/http-tests/system/end-user/PATCH-settings-allow-read.sh b/http-tests/system/end-user/PATCH-settings-allow-read.sh index b37ae23575..de89b87037 100755 --- a/http-tests/system/end-user/PATCH-settings-allow-read.sh +++ b/http-tests/system/end-user/PATCH-settings-allow-read.sh @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE" reset_packages clear_ontology -# lapp:allowRead is load-bearing: when true, AuthorizationFilter skips authorization for ALL GET/HEAD requests +# lds:allowRead is load-bearing: when true, AuthorizationFilter skips authorization for ALL GET/HEAD requests # (apps/model isReadAllowed -> the read short-circuit in AuthorizationFilter). It is off by default and set in no # fixture, so this test toggles it on via PATCH /settings, verifies the effect, and always removes it again (EXIT # trap) so the read-open state cannot leak into other tests. @@ -21,8 +21,8 @@ reset_allow_read() -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ -X PATCH \ -H "Content-Type: application/sparql-update" \ - -d "PREFIX lapp: -DELETE { ?app lapp:allowRead ?value } WHERE { ?app lapp:allowRead ?value }" \ + -d "PREFIX lds: +DELETE { ?app lds:allowRead ?value } WHERE { ?app lds:allowRead ?value }" \ "${END_USER_BASE_URL}settings" purge_cache "$END_USER_VARNISH_SERVICE" purge_cache "$FRONTEND_VARNISH_SERVICE" @@ -39,8 +39,8 @@ curl -k -s -f -o /dev/null \ -E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \ -X PATCH \ -H "Content-Type: application/sparql-update" \ - -d "PREFIX lapp: -INSERT { ?app lapp:allowRead true } WHERE { ?app a lapp:EndUserApplication }" \ + -d "PREFIX lds: +INSERT { ?app lds:allowRead true } WHERE { ?app a lds:EndUserDataspace }" \ "${END_USER_BASE_URL}settings" purge_cache "$END_USER_VARNISH_SERVICE" purge_cache "$ADMIN_VARNISH_SERVICE" @@ -55,8 +55,8 @@ echo "$after" | grep -qE "^($STATUS_OK)$" write=$(curl -k -w "%{http_code}" -o /dev/null -s \ -X PATCH \ -H "Content-Type: application/sparql-update" \ - -d "PREFIX lapp: -INSERT { ?app lapp:allowRead true } WHERE { ?app a lapp:EndUserApplication }" \ + -d "PREFIX lds: +INSERT { ?app lds:allowRead true } WHERE { ?app a lds:EndUserDataspace }" \ "${END_USER_BASE_URL}settings") echo "DEBUG: allowRead certless PATCH /settings - Expected: $STATUS_FORBIDDEN Got: $write" echo "$write" | grep -qE "^($STATUS_FORBIDDEN)$" diff --git a/http-tests/system/end-user/POST-access-request.sh b/http-tests/system/end-user/POST-access-request.sh index fb7a28cf6c..8e7680b0f4 100755 --- a/http-tests/system/end-user/POST-access-request.sh +++ b/http-tests/system/end-user/POST-access-request.sh @@ -21,8 +21,8 @@ actual=$(curl -k -w "%{http_code}" -o /dev/null -s \ --data-urlencode "pu=http://www.w3.org/1999/02/22-rdf-syntax-ns#type" \ --data-urlencode "ou=http://www.w3.org/ns/auth/acl#Authorization" \ --data-urlencode "pu=http://www.w3.org/ns/auth/acl#accessToClass" \ - --data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Container" \ - --data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Item" \ + --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Container" \ + --data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item" \ --data-urlencode "pu=http://www.w3.org/ns/auth/acl#mode" \ --data-urlencode "ou=http://www.w3.org/ns/auth/acl#Read" \ --data-urlencode "pu=http://www.w3.org/2000/01/rdf-schema#label" \ diff --git a/http-tests/versioning/DELETE-removes-file.sh b/http-tests/versioning/DELETE-removes-file.sh index 2acb3e378b..b14d310fec 100755 --- a/http-tests/versioning/DELETE-removes-file.sh +++ b/http-tests/versioning/DELETE-removes-file.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# requires a dataspace configured with lapp:versioningRepository (branch "main", path prefix "graphs") +# requires a dataspace configured with lds:versioningRepository (branch "main", path prefix "graphs") # pointing at $VERSIONING_TEST_REPO ("owner/repo"), with the token in secrets/credentials.trig if [ -z "${VERSIONING_TEST_REPO:-}" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! command -v gh > /dev/null; then @@ -31,7 +31,7 @@ path="${VERSIONING_PATH_PREFIX:-graphs}/${slug}.nt" # create a document and wait for its file to appear -echo "<${doc_url}> . +echo "<${doc_url}> . <${doc_url}> \"To be deleted\" ." | \ ldh put \ -f "$AGENT_CERT_KEYSTORE" \ diff --git a/http-tests/versioning/GET-timegate.sh b/http-tests/versioning/GET-timegate.sh index c5ae98467c..55a3b29113 100755 --- a/http-tests/versioning/GET-timegate.sh +++ b/http-tests/versioning/GET-timegate.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# requires a dataspace configured with lapp:versioningRepository (branch "main", path prefix "graphs") +# requires a dataspace configured with lds:versioningRepository (branch "main", path prefix "graphs") # pointing at $VERSIONING_TEST_REPO ("owner/repo"), with the token in secrets/credentials.trig if [ -z "${VERSIONING_TEST_REPO:-}" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! command -v gh > /dev/null; then @@ -31,7 +31,7 @@ path="${VERSIONING_PATH_PREFIX:-graphs}/${slug}.nt" put_document() { - echo "<${doc_url}> . + echo "<${doc_url}> . <${doc_url}> \"${1}\" ." | \ ldh put \ -f "$AGENT_CERT_KEYSTORE" \ diff --git a/http-tests/versioning/GET-timemap.sh b/http-tests/versioning/GET-timemap.sh index 070b08a141..709777fd23 100755 --- a/http-tests/versioning/GET-timemap.sh +++ b/http-tests/versioning/GET-timemap.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# requires a dataspace configured with lapp:versioningRepository (branch "main", path prefix "graphs") +# requires a dataspace configured with lds:versioningRepository (branch "main", path prefix "graphs") # pointing at $VERSIONING_TEST_REPO ("owner/repo"), with the token in secrets/credentials.trig if [ -z "${VERSIONING_TEST_REPO:-}" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! command -v gh > /dev/null; then @@ -31,7 +31,7 @@ path="${VERSIONING_PATH_PREFIX:-graphs}/${slug}.nt" # create a document and wait for its versioning commit -echo "<${doc_url}> . +echo "<${doc_url}> . <${doc_url}> \"TimeMap test\" ." | \ ldh put \ -f "$AGENT_CERT_KEYSTORE" \ diff --git a/http-tests/versioning/GET-version.sh b/http-tests/versioning/GET-version.sh index efe8d53678..c718f9fd5b 100755 --- a/http-tests/versioning/GET-version.sh +++ b/http-tests/versioning/GET-version.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# requires a dataspace configured with lapp:versioningRepository (branch "main", path prefix "graphs") +# requires a dataspace configured with lds:versioningRepository (branch "main", path prefix "graphs") # pointing at $VERSIONING_TEST_REPO ("owner/repo"), with the token in secrets/credentials.trig if [ -z "${VERSIONING_TEST_REPO:-}" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! command -v gh > /dev/null; then @@ -31,7 +31,7 @@ path="${VERSIONING_PATH_PREFIX:-graphs}/${slug}.nt" put_document() { - echo "<${doc_url}> . + echo "<${doc_url}> . <${doc_url}> \"${1}\" ." | \ ldh put \ -f "$AGENT_CERT_KEYSTORE" \ diff --git a/http-tests/versioning/PUT-creates-commit.sh b/http-tests/versioning/PUT-creates-commit.sh index 9549e17bed..d36b41b88b 100755 --- a/http-tests/versioning/PUT-creates-commit.sh +++ b/http-tests/versioning/PUT-creates-commit.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# requires a dataspace configured with lapp:versioningRepository (branch "main", path prefix "graphs") +# requires a dataspace configured with lds:versioningRepository (branch "main", path prefix "graphs") # pointing at $VERSIONING_TEST_REPO ("owner/repo"), with the token in secrets/credentials.trig if [ -z "${VERSIONING_TEST_REPO:-}" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! command -v gh > /dev/null; then @@ -30,7 +30,7 @@ ldh admin add agent \ slug=$(uuidgen | tr '[:upper:]' '[:lower:]') doc_url="${END_USER_BASE_URL}${slug}/" -echo "<${doc_url}> . +echo "<${doc_url}> . <${doc_url}> \"Versioned document\" ." | \ ldh put \ -f "$AGENT_CERT_KEYSTORE" \ diff --git a/platform/datasets/admin.trig b/platform/datasets/admin.trig index faf253508a..1ca1c0f523 100644 --- a/platform/datasets/admin.trig +++ b/platform/datasets/admin.trig @@ -22,7 +22,7 @@ @prefix lacl: . @prefix adm: . -@prefix dh: . +@prefix dh: . @prefix rdfs: . @prefix owl: . @prefix acl: . diff --git a/platform/datasets/end-user.trig b/platform/datasets/end-user.trig index 3511740817..109900c4e6 100644 --- a/platform/datasets/end-user.trig +++ b/platform/datasets/end-user.trig @@ -20,7 +20,7 @@ ### END-USER-SPECIFIC -@prefix dh: . +@prefix dh: . @prefix sd: . diff --git a/platform/entrypoint.sh b/platform/entrypoint.sh index 51b5afc13a..9e25455592 100755 --- a/platform/entrypoint.sh +++ b/platform/entrypoint.sh @@ -818,13 +818,13 @@ for app in "${apps[@]}"; do printf "\n### Graph store URL (GSP fallback): %s\n" "$app_graph_store_url" fi - if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#EndUserApplication" ]; then + if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#EndUserDataspace" ]; then end_user_endpoint["$app_origin"]="$app_endpoint_url" end_user_auth_user["$app_origin"]="$app_service_auth_user" end_user_auth_pwd["$app_origin"]="$app_service_auth_pwd" end_user_auth_token["$app_origin"]="$app_service_auth_token" fi - if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#AdminApplication" ]; then + if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#AdminDataspace" ]; then admin_endpoint["$app_origin"]="$app_endpoint_url" admin_auth_user["$app_origin"]="$app_service_auth_user" admin_auth_pwd["$app_origin"]="$app_service_auth_pwd" @@ -832,7 +832,7 @@ for app in "${apps[@]}"; do fi # check if this is the root end-user or root admin app by comparing origins - if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#EndUserApplication" ] && [ "$app_origin" = "$ORIGIN" ]; then + if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#EndUserDataspace" ] && [ "$app_origin" = "$ORIGIN" ]; then root_end_user_app="$app_uri" root_end_user_quad_store_url="$app_quad_store_url" root_end_user_store_url="$app_store_url" @@ -841,7 +841,7 @@ for app in "${apps[@]}"; do root_end_user_service_auth_pwd="$app_service_auth_pwd" root_end_user_service_auth_token="$app_service_auth_token" fi - if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#AdminApplication" ] && [ "$app_origin" = "$ADMIN_ORIGIN" ]; then + if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#AdminDataspace" ] && [ "$app_origin" = "$ADMIN_ORIGIN" ]; then root_admin_app="$app_uri" root_admin_quad_store_url="$app_quad_store_url" root_admin_store_url="$app_store_url" @@ -875,7 +875,7 @@ for app in "${apps[@]}"; do printf "\n### Loading datasets for app: %s\n" "$app_uri" mkdir -p "/var/linkeddatahub/based-datasets/${app_folder}" - if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#EndUserApplication" ]; then + if [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#EndUserDataspace" ]; then case "$END_USER_DATASET_URL" in "file://"*) @@ -898,7 +898,7 @@ for app in "${apps[@]}"; do printf "\n### Loading end-user dataset into the triplestore...\n" "$app_store_fn" "$app_store_url" "$app_service_auth_user" "$app_service_auth_pwd" "/var/linkeddatahub/based-datasets/${app_folder}/end-user.nq" "$app_store_content_type" "$app_service_auth_token" - elif [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/apps#AdminApplication" ]; then + elif [ "$app_type" = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#AdminDataspace" ]; then case "$ADMIN_DATASET_URL" in "file://"*) diff --git a/platform/namespace-ontology.trig.template b/platform/namespace-ontology.trig.template index c4e91e9d28..866390d1e0 100644 --- a/platform/namespace-ontology.trig.template +++ b/platform/namespace-ontology.trig.template @@ -3,7 +3,7 @@ @prefix ac: . @prefix rdf: . @prefix xsd: . -@prefix dh: . +@prefix dh: . @prefix sd: . @prefix sp: . @prefix sioc: . diff --git a/platform/root-owner-authorization.trig.template b/platform/root-owner-authorization.trig.template index 35357cd705..f026596ffd 100644 --- a/platform/root-owner-authorization.trig.template +++ b/platform/root-owner-authorization.trig.template @@ -2,7 +2,7 @@ @prefix xsd: . @prefix acl: . @prefix cert: . -@prefix dh: . +@prefix dh: . @prefix sioc: . @prefix foaf: . @prefix dct: . diff --git a/platform/root-owner.trig.template b/platform/root-owner.trig.template index 64567bd60f..e798d50884 100644 --- a/platform/root-owner.trig.template +++ b/platform/root-owner.trig.template @@ -2,7 +2,7 @@ @prefix xsd: . @prefix acl: . @prefix cert: . -@prefix dh: . +@prefix dh: . @prefix sioc: . @prefix foaf: . @prefix dct: . diff --git a/platform/root-secretary-authorization.trig.template b/platform/root-secretary-authorization.trig.template index 4bedeb5cb8..64e771d80b 100644 --- a/platform/root-secretary-authorization.trig.template +++ b/platform/root-secretary-authorization.trig.template @@ -2,7 +2,7 @@ @prefix xsd: . @prefix acl: . @prefix cert: . -@prefix dh: . +@prefix dh: . @prefix sioc: . @prefix foaf: . @prefix dct: . diff --git a/platform/root-secretary.trig.template b/platform/root-secretary.trig.template index 4aa9a333b4..6f7b0854b6 100644 --- a/platform/root-secretary.trig.template +++ b/platform/root-secretary.trig.template @@ -2,7 +2,7 @@ @prefix xsd: . @prefix acl: . @prefix cert: . -@prefix dh: . +@prefix dh: . @prefix sioc: . @prefix foaf: . @prefix dct: . diff --git a/platform/select-root-services.rq b/platform/select-root-services.rq index 33854ec2d3..f591ce4d69 100644 --- a/platform/select-root-services.rq +++ b/platform/select-root-services.rq @@ -1,7 +1,6 @@ -PREFIX ldt: PREFIX sd: PREFIX a: -PREFIX lapp: +PREFIX lds: PREFIX foaf: SELECT ?app ?type ?origin ?quadStore ?graphStore ?endpoint ?authUser ?authPwd ?authToken ?maker @@ -9,9 +8,9 @@ SELECT ?app ?type ?origin ?quadStore ?graphStore ?endpoint ?authUser ?authPwd ?a GRAPH ?appGraph { ?app a ?type ; - lapp:origin ?origin ; - ldt:service ?service . - FILTER(?type IN (lapp:EndUserApplication, lapp:AdminApplication)) + lds:origin ?origin ; + lds:service ?service . + FILTER(?type IN (lds:EndUserDataspace, lds:AdminDataspace)) OPTIONAL { ?app foaf:maker ?maker } GRAPH ?serviceGraph diff --git a/src/main/java/com/atomgraph/linkeddatahub/Application.java b/src/main/java/com/atomgraph/linkeddatahub/Application.java index 679d43a180..854fd5f8b7 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/Application.java +++ b/src/main/java/com/atomgraph/linkeddatahub/Application.java @@ -50,7 +50,6 @@ import com.atomgraph.core.mapper.BadGatewayExceptionMapper; import com.atomgraph.core.provider.QueryParamProvider; import com.atomgraph.linkeddatahub.writer.factory.SourceResolverFactory; -import com.atomgraph.server.vocabulary.LDT; import com.atomgraph.server.mapper.NotFoundExceptionMapper; import com.atomgraph.core.riot.RDFLanguages; import com.atomgraph.core.riot.lang.RDFPostReaderFactory; @@ -60,10 +59,10 @@ import com.atomgraph.linkeddatahub.server.mapper.OntClassNotFoundExceptionMapper; import com.atomgraph.linkeddatahub.server.mapper.jena.QueryExecExceptionMapper; import com.atomgraph.linkeddatahub.server.mapper.jena.RiotParseExceptionMapper; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.model.CSVImport; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.writer.factory.xslt.XsltExecutableSupplier; import com.atomgraph.linkeddatahub.writer.factory.XsltExecutableSupplierFactory; @@ -120,8 +119,8 @@ import com.atomgraph.linkeddatahub.vocabulary.FOAF; import com.atomgraph.linkeddatahub.vocabulary.LDHC; import com.atomgraph.linkeddatahub.vocabulary.Google; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.vocabulary.ORCID; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; import com.atomgraph.linkeddatahub.server.util.PackageService; import com.atomgraph.linkeddatahub.writer.Mode; import com.atomgraph.linkeddatahub.writer.ResultSetXSLTWriter; @@ -786,11 +785,11 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType BuiltinPersonalities.model.add(Authorization.class, AuthorizationImpl.factory); BuiltinPersonalities.model.add(Agent.class, AgentImpl.factory); BuiltinPersonalities.model.add(UserAccount.class, UserAccountImpl.factory); - BuiltinPersonalities.model.add(AdminApplication.class, new com.atomgraph.linkeddatahub.apps.model.admin.impl.ApplicationImplementation()); - BuiltinPersonalities.model.add(EndUserApplication.class, new com.atomgraph.linkeddatahub.apps.model.end_user.impl.ApplicationImplementation()); - BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Application.class, new com.atomgraph.linkeddatahub.apps.model.impl.ApplicationImplementation()); - BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Dataset.class, new com.atomgraph.linkeddatahub.apps.model.impl.DatasetImplementation()); - BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Package.class, new com.atomgraph.linkeddatahub.apps.model.impl.PackageImplementation()); + BuiltinPersonalities.model.add(AdminDataspace.class, new com.atomgraph.linkeddatahub.dataspaces.model.admin.impl.AdminDataspaceImplementation()); + BuiltinPersonalities.model.add(EndUserDataspace.class, new com.atomgraph.linkeddatahub.dataspaces.model.end_user.impl.EndUserDataspaceImplementation()); + BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class, new com.atomgraph.linkeddatahub.dataspaces.model.impl.DataspaceImplementation()); + BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.dataspaces.model.Dataset.class, new com.atomgraph.linkeddatahub.dataspaces.model.impl.DatasetImplementation()); + BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.dataspaces.model.Package.class, new com.atomgraph.linkeddatahub.dataspaces.model.impl.PackageImplementation()); BuiltinPersonalities.model.add(Service.class, new com.atomgraph.linkeddatahub.model.impl.ServiceImplementation()); BuiltinPersonalities.model.add(Import.class, ImportImpl.factory); BuiltinPersonalities.model.add(RDFImport.class, RDFImportImpl.factory); @@ -798,10 +797,10 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.model.File.class, FileImpl.factory); // Build ServiceContext map: keyed by service URI, proxy derived from the app type that references each service. - // Iterating ldt:service statements (app → service) naturally excludes orphan services. + // Iterating lds:service statements (app → service) naturally excludes orphan services. serviceContextMap = new HashMap<>(); org.apache.jena.rdf.model.Model ctxUnion = getContextDataset().getUnionModel(); - org.apache.jena.rdf.model.StmtIterator serviceIt = ctxUnion.listStatements(null, LDT.service, (org.apache.jena.rdf.model.RDFNode) null); + org.apache.jena.rdf.model.StmtIterator serviceIt = ctxUnion.listStatements(null, LDS.service, (org.apache.jena.rdf.model.RDFNode) null); try { while (serviceIt.hasNext()) @@ -811,9 +810,9 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType Resource svcResource = stmt.getResource(); URI proxy; - if (app.hasProperty(RDF.type, LAPP.AdminApplication)) + if (app.hasProperty(RDF.type, LDS.AdminDataspace)) proxy = backendProxyAdmin; - else if (app.hasProperty(RDF.type, LAPP.EndUserApplication)) + else if (app.hasProperty(RDF.type, LDS.EndUserDataspace)) proxy = backendProxyEndUser; else continue; @@ -1107,7 +1106,7 @@ protected void configure() @Override protected void configure() { - bindFactory(ApplicationFactory.class).to(new TypeLiteral>() {}). + bindFactory(ApplicationFactory.class).to(new TypeLiteral>() {}). in(RequestScoped.class); } }); @@ -1116,7 +1115,7 @@ protected void configure() @Override protected void configure() { - bindFactory(com.atomgraph.linkeddatahub.server.factory.UnwrappedApplicationFactory.class).to(com.atomgraph.linkeddatahub.apps.model.Application.class). + bindFactory(com.atomgraph.linkeddatahub.server.factory.UnwrappedApplicationFactory.class).to(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class). in(RequestScoped.class); } }); @@ -1125,7 +1124,7 @@ protected void configure() @Override protected void configure() { - bindFactory(com.atomgraph.linkeddatahub.server.factory.DatasetFactory.class).to(new TypeLiteral>() {}). + bindFactory(com.atomgraph.linkeddatahub.server.factory.DatasetFactory.class).to(new TypeLiteral>() {}). in(RequestScoped.class); } }); @@ -1368,7 +1367,7 @@ public void handleAuthorizationCreated(AuthorizationCreated event) throws Messag String emailText = servletConfig.getServletContext().getInitParameter(LDHC.authorizationEMailText.getURI()); if (emailText == null) throw new InternalServerErrorException(new ConfigurationException(LDHC.authorizationEMailText)); - Resource owner = event.getApplication().getMaker(); + Resource owner = event.getDataspace().getMaker(); Resource auth = event.getAuthorization(); if (auth.hasProperty(ACL.agent)) { @@ -1398,9 +1397,9 @@ public void handleAuthorizationCreated(AuthorizationCreated event) throws Messag MessageBuilder builder = getMessageBuilder(). subject(String.format(emailSubject, - event.getApplication().getProperty(DCTerms.title).getString())). + event.getDataspace().getProperty(DCTerms.title).getString())). to(mbox, name). - textBodyPart(String.format(emailText, owner.getURI(), accessToList, accessToClassList, event.getApplication().getBaseURI())); + textBodyPart(String.format(emailText, owner.getURI(), accessToList, accessToClassList, event.getDataspace().getBaseURI())); if (getNotificationAddress() != null) builder = builder.from(getNotificationAddress()); @@ -1416,7 +1415,7 @@ public void handleAuthorizationCreated(AuthorizationCreated event) throws Messag */ public Resource matchApp(URI absolutePath) { - return getAppByOrigin(getContextModel(), LAPP.Application, absolutePath); // make sure we return an immutable model + return getAppByOrigin(getContextModel(), LDS.Dataspace, absolutePath); // make sure we return an immutable model } /** @@ -1427,7 +1426,7 @@ public Resource matchApp(URI absolutePath) */ public Resource getLongestURIResource(Map lengthMap) { - // select the app with the longest URI match, as the model contains a pair of EndUserApplication/AdminApplication + // select the app with the longest URI match, as the model contains a pair of EndUserDataspace/AdminDataspace TreeMap apps = new TreeMap(lengthMap); if (!apps.isEmpty()) return apps.lastEntry().getValue(); @@ -1485,9 +1484,9 @@ public Resource getAppByOrigin(Model model, Resource type, URI absolutePath) Resource app = it.next(); // Use origin-based matching - return immediately on match since origins are unique - if (app.hasProperty(LAPP.origin)) + if (app.hasProperty(LDS.origin)) { - URI appOriginURI = URI.create(app.getPropertyResourceValue(LAPP.origin).getURI()); + URI appOriginURI = URI.create(app.getPropertyResourceValue(LDS.origin).getURI()); String normalizedAppOrigin = normalizeOrigin(appOriginURI); if (requestOrigin.equals(normalizedAppOrigin)) return app; @@ -1552,10 +1551,10 @@ public Map getRelativeDatasets(Model model, Resource type, URI ab { Resource dataset = it.next(); - if (!dataset.hasProperty(LAPP.prefix)) - throw new InternalServerErrorException(new IllegalStateException("Dataset resource <" + dataset.getURI() + "> has no lapp:prefix value")); + if (!dataset.hasProperty(LDS.prefix)) + throw new InternalServerErrorException(new IllegalStateException("Dataset resource <" + dataset.getURI() + "> has no lds:prefix value")); - URI prefix = URI.create(dataset.getPropertyResourceValue(LAPP.prefix).getURI()); + URI prefix = URI.create(dataset.getPropertyResourceValue(LDS.prefix).getURI()); URI relative = prefix.relativize(absolutePath); if (!relative.isAbsolute() && !relative.toString().equals("")) datasets.put(prefix, dataset); } @@ -1597,7 +1596,7 @@ public Map getLengthMap(Map apps) * @param baseURI application's base URI * @param gsc Graph Store client */ - public void submitImport(CSVImport csvImport, com.atomgraph.linkeddatahub.apps.model.Application app, Service service, Service adminService, String baseURI, GraphStoreClient gsc) + public void submitImport(CSVImport csvImport, com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, Service service, Service adminService, String baseURI, GraphStoreClient gsc) { new ImportExecutor(importThreadPool).start(service, adminService, this, baseURI, gsc, csvImport); } @@ -1612,7 +1611,7 @@ public void submitImport(CSVImport csvImport, com.atomgraph.linkeddatahub.apps.m * @param baseURI application's base URI * @param gsc Graph Store client */ - public void submitImport(RDFImport rdfImport, com.atomgraph.linkeddatahub.apps.model.Application app, Service service, Service adminService, String baseURI, GraphStoreClient gsc) + public void submitImport(RDFImport rdfImport, com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, Service service, Service adminService, String baseURI, GraphStoreClient gsc) { new ImportExecutor(importThreadPool).start(service, adminService, this, baseURI, gsc, rdfImport); } @@ -2048,7 +2047,7 @@ protected Map getEndUserRepositories() * @param app end-user application resource * @return ontology repository */ - public OntologyRepository getRepository(EndUserApplication app) + public OntologyRepository getRepository(EndUserDataspace app) { return getEndUserRepositories().computeIfAbsent(app.getURI(), uri -> createRepository(app)); } @@ -2061,7 +2060,7 @@ public OntologyRepository getRepository(EndUserApplication app) * @param app end-user application resource * @return ontology repository */ - public OntologyRepository createRepository(EndUserApplication app) + public OntologyRepository createRepository(EndUserDataspace app) { OntologyRepository appRepository = new OntologyRepository(app, this, GraphStoreClient.create(getClient(), getMediaTypes()), getOntologyQuery()); // seed bundled vocabulary/ontology mappings from the global repository. They are the fallback now, @@ -2399,7 +2398,7 @@ public Model getContextModel() * @param application the dataspace application * @return the model for the specified dataspace, or null if not found */ - public Model getDataspaceModel(com.atomgraph.linkeddatahub.apps.model.Application application) + public Model getDataspaceModel(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application) { if (application == null) throw new IllegalArgumentException("Application cannot be null"); return ModelFactory.createModelForGraph(new GraphReadOnly(getContextDataset().getNamedModel(application.getURI()).getGraph())); @@ -2416,7 +2415,7 @@ public Model getDataspaceModel(com.atomgraph.linkeddatahub.apps.model.Applicatio * @param newModel the new RDF model to replace the existing named graph * @throws IOException if an I/O error occurs */ - public void updateApp(com.atomgraph.linkeddatahub.apps.model.Application application, Model newModel) throws IOException + public void updateApp(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, Model newModel) throws IOException { if (application == null) throw new IllegalArgumentException("Application cannot be null"); if (newModel == null) throw new IllegalArgumentException("Model cannot be null"); diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/AdminApplication.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/AdminDataspace.java similarity index 90% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/AdminApplication.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/AdminDataspace.java index 075c579a39..5119c596ea 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/AdminApplication.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/AdminDataspace.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model; +package com.atomgraph.linkeddatahub.dataspaces.model; /** * Administrative application. @@ -22,7 +22,7 @@ * * @author Martynas Jusevičius {@literal } */ -public interface AdminApplication extends Application +public interface AdminDataspace extends Dataspace { /** @@ -45,6 +45,6 @@ public interface AdminApplication extends Application * * @return end-user application */ - EndUserApplication getEndUserApplication(); + EndUserDataspace getEndUserDataspace(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Dataset.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataset.java similarity index 97% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/Dataset.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataset.java index edead905e5..f03cabe06a 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Dataset.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataset.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model; +package com.atomgraph.linkeddatahub.dataspaces.model; import com.atomgraph.linkeddatahub.model.Service; import java.net.URI; diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Application.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataspace.java similarity index 96% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/Application.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataspace.java index bc47f90b27..4f59b3d55c 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Application.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Dataspace.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model; +package com.atomgraph.linkeddatahub.dataspaces.model; import com.atomgraph.linkeddatahub.model.Service; import jakarta.ws.rs.core.UriBuilder; @@ -27,7 +27,7 @@ * * @author Martynas Jusevičius {@literal } */ -public interface Application extends Resource +public interface Dataspace extends Resource { /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/EndUserApplication.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/EndUserDataspace.java similarity index 86% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/EndUserApplication.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/EndUserDataspace.java index a41e9faa9e..39d56887ea 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/EndUserApplication.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/EndUserDataspace.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model; +package com.atomgraph.linkeddatahub.dataspaces.model; /** * End-user application. @@ -22,13 +22,13 @@ * * @author Martynas Jusevičius {@literal } */ -public interface EndUserApplication extends Application +public interface EndUserDataspace extends Dataspace { /** * Returns the admin application paired with this end-user application. * @return admin application */ - AdminApplication getAdminApplication(); + AdminDataspace getAdminDataspace(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Package.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Package.java similarity index 96% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/Package.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Package.java index 4ad8b71e50..a4e34b9236 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/Package.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/Package.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model; +package com.atomgraph.linkeddatahub.dataspaces.model; import org.apache.jena.rdf.model.Resource; diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImpl.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImpl.java similarity index 73% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImpl.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImpl.java index 0e99f2aac6..bab5e56524 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImpl.java @@ -14,12 +14,12 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.admin.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.admin.impl; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.vocabulary.Admin; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.net.URI; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.graph.Node; @@ -33,10 +33,10 @@ * * @author Martynas Jusevičius {@literal } */ -public class ApplicationImpl extends com.atomgraph.linkeddatahub.apps.model.impl.ApplicationImpl implements AdminApplication +public class AdminDataspaceImpl extends com.atomgraph.linkeddatahub.dataspaces.model.impl.DataspaceImpl implements AdminDataspace { - private static final Logger log = LoggerFactory.getLogger(ApplicationImpl.class); + private static final Logger log = LoggerFactory.getLogger(AdminDataspaceImpl.class); /** * Constructs instance from node and graph. @@ -44,13 +44,13 @@ public class ApplicationImpl extends com.atomgraph.linkeddatahub.apps.model.impl * @param n node * @param g graph */ - public ApplicationImpl(Node n, EnhGraph g) + public AdminDataspaceImpl(Node n, EnhGraph g) { super(n, g); } @Override - public EndUserApplication getEndUserApplication() + public EndUserDataspace getEndUserDataspace() { URI originURI = getOriginURI(); if (originURI == null) return null; @@ -62,11 +62,11 @@ public EndUserApplication getEndUserApplication() URI endUserOrigin = URI.create(originURI.getScheme() + "://" + endUserHost + (originURI.getPort() != -1 ? ":" + originURI.getPort() : "")); - ResIterator it = getModel().listSubjectsWithProperty(LAPP.origin, + ResIterator it = getModel().listSubjectsWithProperty(LDS.origin, getModel().createResource(endUserOrigin.toString())); try { - if (it.hasNext()) return it.next().as(EndUserApplication.class); + if (it.hasNext()) return it.next().as(EndUserDataspace.class); } finally { diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImplementation.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImplementation.java similarity index 76% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImplementation.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImplementation.java index d133891acd..6c29f00398 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/admin/impl/ApplicationImplementation.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/admin/impl/AdminDataspaceImplementation.java @@ -14,9 +14,9 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.admin.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.admin.impl; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.enhanced.EnhNode; import org.apache.jena.enhanced.Implementation; @@ -29,7 +29,7 @@ * * @author {@literal Martynas Jusevičius } */ -public class ApplicationImplementation extends Implementation +public class AdminDataspaceImplementation extends Implementation { @Override @@ -37,11 +37,11 @@ public EnhNode wrap(Node node, EnhGraph enhGraph) { if (canWrap(node, enhGraph)) { - return new ApplicationImpl(node, enhGraph); + return new AdminDataspaceImpl(node, enhGraph); } else { - throw new ConversionException("Cannot convert node " + node.toString() + " to AdminApplication: it does not have rdf:type lapp:AdminApplication or equivalent"); + throw new ConversionException("Cannot convert node " + node.toString() + " to AdminDataspace: it does not have rdf:type lds:AdminDataspace or equivalent"); } } @@ -50,7 +50,7 @@ public boolean canWrap(Node node, EnhGraph eg) { if (eg == null) throw new IllegalArgumentException("EnhGraph cannot be null"); - return eg.asGraph().contains(node, RDF.type.asNode(), LAPP.AdminApplication.asNode()); + return eg.asGraph().contains(node, RDF.type.asNode(), LDS.AdminDataspace.asNode()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImpl.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImpl.java similarity index 70% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImpl.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImpl.java index 4341f4a016..26327b025b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImpl.java @@ -14,27 +14,27 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.end_user.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.end_user.impl; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import java.net.URI; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.graph.Node; import org.apache.jena.rdf.model.ResIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; /** * End-user application implementation. * * @author Martynas Jusevičius {@literal } */ -public class ApplicationImpl extends com.atomgraph.linkeddatahub.apps.model.impl.ApplicationImpl implements EndUserApplication +public class EndUserDataspaceImpl extends com.atomgraph.linkeddatahub.dataspaces.model.impl.DataspaceImpl implements EndUserDataspace { - private static final Logger log = LoggerFactory.getLogger(ApplicationImpl.class); + private static final Logger log = LoggerFactory.getLogger(EndUserDataspaceImpl.class); /** * Constructs instance from node and graph. @@ -42,13 +42,13 @@ public class ApplicationImpl extends com.atomgraph.linkeddatahub.apps.model.impl * @param n node * @param g graph */ - public ApplicationImpl(Node n, EnhGraph g) + public EndUserDataspaceImpl(Node n, EnhGraph g) { super(n, g); } @Override - public AdminApplication getAdminApplication() + public AdminDataspace getAdminDataspace() { URI originURI = getOriginURI(); if (originURI == null) return null; @@ -58,11 +58,11 @@ public AdminApplication getAdminApplication() URI adminOrigin = URI.create(originURI.getScheme() + "://" + adminHost + (originURI.getPort() != -1 ? ":" + originURI.getPort() : "")); - ResIterator it = getModel().listSubjectsWithProperty(LAPP.origin, + ResIterator it = getModel().listSubjectsWithProperty(LDS.origin, getModel().createResource(adminOrigin.toString())); try { - if (it.hasNext()) return it.next().as(AdminApplication.class); + if (it.hasNext()) return it.next().as(AdminDataspace.class); } finally { diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImplementation.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImplementation.java similarity index 76% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImplementation.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImplementation.java index 456982e16c..b0f930e9fe 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/end_user/impl/ApplicationImplementation.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/end_user/impl/EndUserDataspaceImplementation.java @@ -14,9 +14,9 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.end_user.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.end_user.impl; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.enhanced.EnhNode; import org.apache.jena.enhanced.Implementation; @@ -29,7 +29,7 @@ * * @author {@literal Martynas Jusevičius } */ -public class ApplicationImplementation extends Implementation +public class EndUserDataspaceImplementation extends Implementation { @Override @@ -37,11 +37,11 @@ public EnhNode wrap(Node node, EnhGraph enhGraph) { if (canWrap(node, enhGraph)) { - return new ApplicationImpl(node, enhGraph); + return new EndUserDataspaceImpl(node, enhGraph); } else { - throw new ConversionException( "Cannot convert node " + node.toString() + " to EndUserApplication: it does not have rdf:type lapp:EndUserApplication or equivalent"); + throw new ConversionException( "Cannot convert node " + node.toString() + " to EndUserDataspace: it does not have rdf:type lds:EndUserDataspace or equivalent"); } } @@ -50,7 +50,7 @@ public boolean canWrap(Node node, EnhGraph eg) { if (eg == null) throw new IllegalArgumentException("EnhGraph cannot be null"); - return eg.asGraph().contains(node, RDF.type.asNode(), LAPP.EndUserApplication.asNode()); + return eg.asGraph().contains(node, RDF.type.asNode(), LDS.EndUserDataspace.asNode()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImpl.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImpl.java similarity index 84% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImpl.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImpl.java index 73a5e291cc..8f83704e75 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImpl.java @@ -14,12 +14,11 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; -import com.atomgraph.linkeddatahub.apps.model.Dataset; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataset; import com.atomgraph.linkeddatahub.model.Service; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; -import com.atomgraph.server.vocabulary.LDT; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.net.URI; import jakarta.ws.rs.core.UriBuilder; import org.apache.jena.enhanced.EnhGraph; @@ -50,13 +49,13 @@ public DatasetImpl(Node n, EnhGraph g) @Override public Resource getPrefix() { - return getPropertyResourceValue(LAPP.prefix); + return getPropertyResourceValue(LDS.prefix); } @Override public Resource getBackendProxy() { - return getPropertyResourceValue(LAPP.backendProxy); + return getPropertyResourceValue(LDS.backendProxy); } @Override @@ -80,7 +79,7 @@ public URI getProxied(URI uri) @Override public Service getService() { - Resource service = getPropertyResourceValue(LDT.service); + Resource service = getPropertyResourceValue(LDS.service); if (service != null) return service.as(Service.class); diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImplementation.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImplementation.java similarity index 84% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImplementation.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImplementation.java index f298cc39d3..ced400ae97 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImplementation.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DatasetImplementation.java @@ -14,9 +14,9 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.enhanced.EnhNode; import org.apache.jena.enhanced.Implementation; @@ -41,7 +41,7 @@ public EnhNode wrap(Node node, EnhGraph enhGraph) } else { - throw new ConversionException("Cannot convert node " + node.toString() + " to Application: it does not have rdf:type lapp:Application or equivalent"); + throw new ConversionException("Cannot convert node " + node.toString() + " to Dataspace: it does not have rdf:type lds:Dataspace or equivalent"); } } @@ -50,7 +50,7 @@ public boolean canWrap(Node node, EnhGraph eg) { if (eg == null) throw new IllegalArgumentException("EnhGraph cannot be null"); - return eg.asGraph().contains(node, RDF.type.asNode(), LAPP.Dataset.asNode()); + return eg.asGraph().contains(node, RDF.type.asNode(), LDS.Dataset.asNode()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImpl.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImpl.java similarity index 82% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImpl.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImpl.java index e0c3322e5e..6a667779ef 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImpl.java @@ -14,15 +14,14 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; import com.atomgraph.client.vocabulary.AC; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.vocabulary.FOAF; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.vocabulary.LDH; -import com.atomgraph.server.vocabulary.LDT; import jakarta.ws.rs.core.UriBuilder; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.graph.Node; @@ -37,14 +36,14 @@ import org.apache.jena.rdf.model.impl.ResourceImpl; /** - * Application implementation. + * Dataspace implementation. * Extends RDF resource implementation. * * @author Martynas Jusevičius {@literal } */ -public class ApplicationImpl extends ResourceImpl implements Application +public class DataspaceImpl extends ResourceImpl implements Dataspace { - private static final Logger log = LoggerFactory.getLogger(ApplicationImpl.class); + private static final Logger log = LoggerFactory.getLogger(DataspaceImpl.class); /** * Constructs instance from node and graph. @@ -52,7 +51,7 @@ public class ApplicationImpl extends ResourceImpl implements Application * @param n node * @param g graph */ - public ApplicationImpl(Node n, EnhGraph g) + public DataspaceImpl(Node n, EnhGraph g) { super(n, g); } @@ -72,7 +71,7 @@ public URI getBaseURI() @Override public Resource getOrigin() { - return getPropertyResourceValue(LAPP.origin); + return getPropertyResourceValue(LDS.origin); } @Override @@ -92,13 +91,13 @@ public Resource getMaker() @Override public Resource getOntology() { - return getPropertyResourceValue(LDT.ontology); + return getPropertyResourceValue(LDS.ontology); } @Override public Service getService() { - Resource service = getPropertyResourceValue(LDT.service); + Resource service = getPropertyResourceValue(LDS.service); if (service != null) return service.as(Service.class); @@ -114,7 +113,7 @@ public Resource getStylesheet() @Override public boolean isReadAllowed() { - Statement stmt = getProperty(LAPP.allowRead); + Statement stmt = getProperty(LDS.allowRead); if (stmt != null) return stmt.getBoolean(); diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImplementation.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImplementation.java similarity index 77% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImplementation.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImplementation.java index a5a8c68c89..650246b901 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImplementation.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/DataspaceImplementation.java @@ -14,9 +14,9 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.enhanced.EnhNode; import org.apache.jena.enhanced.Implementation; @@ -29,7 +29,7 @@ * * @author {@literal Martynas Jusevičius } */ -public class ApplicationImplementation extends Implementation +public class DataspaceImplementation extends Implementation { @Override @@ -37,11 +37,11 @@ public EnhNode wrap(Node node, EnhGraph enhGraph) { if (canWrap(node, enhGraph)) { - return new ApplicationImpl(node, enhGraph); + return new DataspaceImpl(node, enhGraph); } else { - throw new ConversionException("Cannot convert node " + node.toString() + " to Application: it does not have rdf:type lapp:Application or equivalent"); + throw new ConversionException("Cannot convert node " + node.toString() + " to Dataspace: it does not have rdf:type lds:Dataspace or equivalent"); } } @@ -50,7 +50,7 @@ public boolean canWrap(Node node, EnhGraph eg) { if (eg == null) throw new IllegalArgumentException("EnhGraph cannot be null"); - return eg.asGraph().contains(node, RDF.type.asNode(), LAPP.Application.asNode()); + return eg.asGraph().contains(node, RDF.type.asNode(), LDS.Dataspace.asNode()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImpl.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImpl.java similarity index 90% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImpl.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImpl.java index a431ee2628..5c52f6834a 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImpl.java @@ -14,12 +14,12 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; import com.atomgraph.client.vocabulary.AC; -import com.atomgraph.linkeddatahub.apps.model.Package; +import com.atomgraph.linkeddatahub.dataspaces.model.Package; import com.atomgraph.linkeddatahub.vocabulary.LDH; -import com.atomgraph.server.vocabulary.LDT; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.graph.Node; import org.apache.jena.rdf.model.Resource; @@ -53,7 +53,7 @@ public PackageImpl(Node n, EnhGraph g) @Override public Resource getOntology() { - return getPropertyResourceValue(LDT.ontology); + return getPropertyResourceValue(LDS.ontology); } @Override diff --git a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImplementation.java b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImplementation.java similarity index 85% rename from src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImplementation.java rename to src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImplementation.java index 09ebb5e9db..98d1e53740 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/PackageImplementation.java +++ b/src/main/java/com/atomgraph/linkeddatahub/dataspaces/model/impl/PackageImplementation.java @@ -14,9 +14,9 @@ * limitations under the License. * */ -package com.atomgraph.linkeddatahub.apps.model.impl; +package com.atomgraph.linkeddatahub.dataspaces.model.impl; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import org.apache.jena.enhanced.EnhGraph; import org.apache.jena.enhanced.EnhNode; import org.apache.jena.enhanced.Implementation; @@ -41,7 +41,7 @@ public EnhNode wrap(Node node, EnhGraph enhGraph) } else { - throw new ConversionException("Cannot convert node " + node.toString() + " to Package: it does not have rdf:type lapp:Package"); + throw new ConversionException("Cannot convert node " + node.toString() + " to Package: it does not have rdf:type lds:Package"); } } @@ -50,7 +50,7 @@ public boolean canWrap(Node node, EnhGraph eg) { if (eg == null) throw new IllegalArgumentException("EnhGraph cannot be null"); - return eg.asGraph().contains(node, RDF.type.asNode(), LAPP.Package.asNode()); + return eg.asGraph().contains(node, RDF.type.asNode(), LDS.Package.asNode()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/imports/ImportExecutor.java b/src/main/java/com/atomgraph/linkeddatahub/imports/ImportExecutor.java index 2a1058b410..0f1fa4209c 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/imports/ImportExecutor.java +++ b/src/main/java/com/atomgraph/linkeddatahub/imports/ImportExecutor.java @@ -17,7 +17,6 @@ package com.atomgraph.linkeddatahub.imports; import com.atomgraph.client.MediaTypes; -import com.atomgraph.server.vocabulary.LDT; import com.atomgraph.core.model.DatasetAccessor; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import com.atomgraph.linkeddatahub.imports.stream.RDFGraphStoreOutput; @@ -31,6 +30,7 @@ import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.server.exception.ImportException; import com.atomgraph.linkeddatahub.server.util.Skolemizer; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.vocabulary.PROV; import com.atomgraph.linkeddatahub.vocabulary.VoID; import com.univocity.parsers.common.TextParsingException; @@ -119,7 +119,7 @@ public void start(Service service, Service adminService, com.atomgraph.linkeddat String queryBaseURI = csvImport.getFile().getURI(); // file URI becomes the query base URI QueryLoader queryLoader = new QueryLoader(URI.create(csvImport.getQuery().getURI()), queryBaseURI, Syntax.syntaxARQ, gsc); ParameterizedSparqlString pss = new ParameterizedSparqlString(queryLoader.get().toString(), queryBaseURI); - pss.setIri(LDT.base.getLocalName(), appBaseURI); // app's base URI becomes $base + pss.setIri(LDS.base.getLocalName(), appBaseURI); // app's base URI becomes $base final Query query = pss.asQuery(); Supplier fileSupplier = new ClientResponseSupplier(gsc, CSV_MEDIA_TYPES, URI.create(csvImport.getFile().getURI())); @@ -157,7 +157,7 @@ public void start(Service service, Service adminService, com.atomgraph.linkeddat { QueryLoader queryLoader = new QueryLoader(URI.create(rdfImport.getQuery().getURI()), queryBaseURI, Syntax.syntaxARQ, gsc); ParameterizedSparqlString pss = new ParameterizedSparqlString(queryLoader.get().toString(), queryBaseURI); - pss.setIri(LDT.base.getLocalName(), appBaseURI); // app's base URI becomes $base + pss.setIri(LDS.base.getLocalName(), appBaseURI); // app's base URI becomes $base query = pss.asQuery(); } else diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/Namespace.java b/src/main/java/com/atomgraph/linkeddatahub/resource/Namespace.java index ac3278e2cf..5038087b01 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/Namespace.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/Namespace.java @@ -27,8 +27,8 @@ import static com.atomgraph.core.model.SPARQLEndpoint.USING_GRAPH_URI; import static com.atomgraph.core.model.SPARQLEndpoint.USING_NAMED_GRAPH_URI; import com.atomgraph.core.model.impl.dataset.ServiceImpl; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.server.util.OntologyRepository; import java.net.URI; import java.util.List; @@ -64,7 +64,7 @@ public class Namespace extends com.atomgraph.core.model.impl.SPARQLEndpointImpl private final URI uri; private final UriInfo uriInfo; - private final Application application; + private final Dataspace application; private final OntModel ontology; private final com.atomgraph.linkeddatahub.Application system; @@ -81,7 +81,7 @@ public class Namespace extends com.atomgraph.core.model.impl.SPARQLEndpointImpl */ @Inject public Namespace(@Context Request request, @Context UriInfo uriInfo, - Application application, Optional ontology, MediaTypes mediaTypes, + Dataspace application, Optional ontology, MediaTypes mediaTypes, @Context SecurityContext securityContext, com.atomgraph.linkeddatahub.Application system) { super(request, new ServiceImpl(DatasetFactory.create(ontology.get()), mediaTypes), mediaTypes); @@ -115,14 +115,14 @@ public Response get(@QueryParam(QUERY) Query query, // if query param is not provided and the app is end-user, return the namespace ontology associated with this document if (query == null) { - if (getApplication().canAs(EndUserApplication.class)) + if (getDataspace().canAs(EndUserDataspace.class)) { // the application ontology MUST use a URI! This is the URI this ontology endpoint is deployed on by the Dispatcher class - String ontologyURI = getApplication().getOntology().getURI(); + String ontologyURI = getDataspace().getOntology().getURI(); if (log.isDebugEnabled()) log.debug("Returning raw namespace ontology: {}", ontologyURI); // not returning the injected in-memory ontology because it is the full imports closure (a union view); // the shared repository serves the standalone raw ontology graph - OntologyRepository repository = getSystem().getRepository(getApplication().as(EndUserApplication.class)); + OntologyRepository repository = getSystem().getRepository(getDataspace().as(EndUserDataspace.class)); return getResponseBuilder(org.apache.jena.rdf.model.ModelFactory.createModelForGraph(repository.get(ontologyURI))).build(); } else throw new BadRequestException("SPARQL query string not provided"); @@ -180,7 +180,7 @@ public UriInfo getUriInfo() * * @return application resource */ - public Application getApplication() + public Dataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/Settings.java b/src/main/java/com/atomgraph/linkeddatahub/resource/Settings.java index 30df84215b..38de7b259b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/Settings.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/Settings.java @@ -17,11 +17,11 @@ package com.atomgraph.linkeddatahub.resource; import com.atomgraph.core.util.ModelUtils; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import com.atomgraph.linkeddatahub.resource.admin.ClearOntology; import com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider; import com.atomgraph.linkeddatahub.server.util.EntityTags; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.net.URI; import jakarta.ws.rs.container.ResourceContext; import jakarta.inject.Inject; @@ -61,7 +61,7 @@ public class Settings { private static final Logger log = LoggerFactory.getLogger(Settings.class); - private final Application application; + private final Dataspace application; private final com.atomgraph.linkeddatahub.Application system; private final Providers providers; private final Request request; @@ -77,7 +77,7 @@ public class Settings * @param resourceContext JAX-RS resource context (for delegating to sub-resources) */ @Inject - public Settings(Application application, com.atomgraph.linkeddatahub.Application system, @Context Providers providers, @Context Request request, @Context ResourceContext resourceContext) + public Settings(Dataspace application, com.atomgraph.linkeddatahub.Application system, @Context Providers providers, @Context Request request, @Context ResourceContext resourceContext) { this.application = application; this.system = system; @@ -94,15 +94,15 @@ public Settings(Application application, com.atomgraph.linkeddatahub.Application @GET public Response get() { - Model dataspaceModel = getSystem().getDataspaceModel(getApplication()); + Model dataspaceModel = getSystem().getDataspaceModel(getDataspace()); if (dataspaceModel == null || dataspaceModel.isEmpty()) { - if (log.isWarnEnabled()) log.warn("No settings found for dataspace <{}> in context dataset", getApplication().getURI()); + if (log.isWarnEnabled()) log.warn("No settings found for dataspace <{}> in context dataset", getDataspace().getURI()); return Response.status(Response.Status.NOT_FOUND).build(); } - if (log.isDebugEnabled()) log.debug("Retrieved settings for dataspace <{}>", getApplication().getURI()); + if (log.isDebugEnabled()) log.debug("Retrieved settings for dataspace <{}>", getDataspace().getURI()); EntityTag entityTag = getEntityTag(dataspaceModel); Response.ResponseBuilder rb = getRequest().evaluatePreconditions(entityTag); @@ -126,12 +126,12 @@ public Response patch(UpdateRequest updateRequest) throws IOException { if (updateRequest == null) throw new BadRequestException("SPARQL update not specified"); - if (log.isDebugEnabled()) log.debug("PATCH request for dataspace <{}>", getApplication().getURI()); + if (log.isDebugEnabled()) log.debug("PATCH request for dataspace <{}>", getDataspace().getURI()); if (log.isDebugEnabled()) log.debug("PATCH update string: {}", updateRequest.toString()); - Model dataspaceModel = getSystem().getDataspaceModel(getApplication()); + Model dataspaceModel = getSystem().getDataspaceModel(getDataspace()); if (dataspaceModel == null || dataspaceModel.isEmpty()) - throw new NotFoundException("No settings found for dataspace <" + getApplication().getURI() + "> in context dataset"); + throw new NotFoundException("No settings found for dataspace <" + getDataspace().getURI() + "> in context dataset"); // Create a mutable copy since getDataspaceModel() returns a read-only view Model mutableModel = ModelFactory.createDefaultModel().add(dataspaceModel); @@ -141,10 +141,10 @@ public Response patch(UpdateRequest updateRequest) throws IOException UpdateAction.execute(updateRequest, dataset); // Verify the application resource still exists with correct type after PATCH - Resource appResource = ResourceFactory.createResource(getApplication().getURI()); - if (!mutableModel.contains(appResource, RDF.type, LAPP.EndUserApplication)) + Resource appResource = ResourceFactory.createResource(getDataspace().getURI()); + if (!mutableModel.contains(appResource, RDF.type, LDS.EndUserDataspace)) { - if (log.isWarnEnabled()) log.warn("PATCH removed application resource or its type for <{}>", getApplication().getURI()); + if (log.isWarnEnabled()) log.warn("PATCH removed application resource or its type for <{}>", getDataspace().getURI()); throw new WebApplicationException("PATCH cannot remove the application resource or its type", UNPROCESSABLE_ENTITY.getStatusCode()); // 422 Unprocessable Entity } @@ -152,7 +152,7 @@ public Response patch(UpdateRequest updateRequest) throws IOException validate(mutableModel); // Write the updated model back to the context dataset file - getSystem().updateApp(getApplication(), mutableModel); + getSystem().updateApp(getDataspace(), mutableModel); // clear and reload the ontology so the next request re-derives with the updated ldh:import set. // Delegate to ClearOntology (context-agnostic) for the full eviction - repository graph + closure @@ -162,10 +162,10 @@ public Response patch(UpdateRequest updateRequest) throws IOException // evaluated again: what guarded it is the authorization on this PATCH. Both are owner-only today // (acl/groups/owners/#this in admin.trig), so they agree - but widening the settings ACL would // widen the clear with it, silently, without touching /clear or any of its tests - if (getApplication().getOntology() != null) - getResourceContext().getResource(ClearOntology.class).post(getApplication().getOntology().getURI(), null); + if (getDataspace().getOntology() != null) + getResourceContext().getResource(ClearOntology.class).post(getDataspace().getOntology().getURI(), null); - if (log.isInfoEnabled()) log.info("Updated settings for dataspace <{}> via PATCH", getApplication().getURI()); + if (log.isInfoEnabled()) log.info("Updated settings for dataspace <{}> via PATCH", getDataspace().getURI()); return Response.noContent().build(); } @@ -175,7 +175,7 @@ public Response patch(UpdateRequest updateRequest) throws IOException * * @return the application */ - public Application getApplication() + public Dataspace getDataspace() { return application; } @@ -246,7 +246,7 @@ public EntityTag getEntityTag(Model model) // DocumentHierarchyGraphStoreImpl#getEntityTag: settings are PATCHable by an agent holding // acl:Write without acl:Read, who can therefore move this tag without being able to read // what it describes - and with an XOR fold that difference tells them what is in it - return EntityTags.entityTag(URI.create(getApplication().getURI()), model); + return EntityTags.entityTag(URI.create(getDataspace().getURI()), model); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/acl/Access.java b/src/main/java/com/atomgraph/linkeddatahub/resource/acl/Access.java index 4b286d3a3a..7f289abc4e 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/acl/Access.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/acl/Access.java @@ -19,9 +19,9 @@ import com.atomgraph.client.util.HTMLMediaTypePredicate; import com.atomgraph.core.MediaTypes; import com.atomgraph.core.util.ModelUtils; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.security.AgentContext; @@ -69,7 +69,7 @@ public class Access private final Request request; private final UriInfo uriInfo; private final MediaTypes mediaTypes; - private final EndUserApplication application; + private final EndUserDataspace application; private final Optional agentContext; private final ParameterizedSparqlString documentTypeQuery, documentOwnerQuery, aclQuery, ownerAclQuery; private final com.atomgraph.linkeddatahub.Application system; @@ -86,14 +86,14 @@ public class Access */ @Inject public Access(@Context Request request, @Context UriInfo uriInfo, MediaTypes mediaTypes, - Application application, Optional agentContext, + Dataspace application, Optional agentContext, com.atomgraph.linkeddatahub.Application system) { - if (!application.canAs(EndUserApplication.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); + if (!application.canAs(EndUserDataspace.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); this.request = request; this.uriInfo = uriInfo; this.mediaTypes = mediaTypes; - this.application = application.as(EndUserApplication.class); + this.application = application.as(EndUserDataspace.class); this.agentContext = agentContext; this.system = system; documentTypeQuery = new ParameterizedSparqlString(system.getDocumentTypeQuery().toString()); @@ -128,14 +128,14 @@ public Response get() try { final ParameterizedSparqlString authPss = getACLQuery(); - authPss.setParams(new AuthorizationParams(getApplication().getAdminApplication().getBase(), accessTo, agent).get()); + authPss.setParams(new AuthorizationParams(getDataspace().getAdminDataspace().getBase(), accessTo, agent).get()); // inject the resource's rdf:types so acl:accessToClass authorizations are reported; without this the ACL // query keeps its fail-closed default (VALUES ?Type { rdfs:Resource }) and hides every class-based authorization Query authQuery = authPss.asQuery(); if (docTypesResult.hasNext()) authQuery = new SetResultSetValues().apply(authQuery, docTypesResult); - Model authModel = getSystem().getServiceContext(getApplication().getAdminApplication().getService()).getSPARQLClient().loadModel(authQuery); + Model authModel = getSystem().getServiceContext(getDataspace().getAdminDataspace().getService()).getSPARQLClient().loadModel(authQuery); // filter out authorizations with acl:accessToClass foaf:Agent - all agents already have that access ResIterator agentClassIter = authModel.listSubjectsWithProperty(ACL.agentClass, FOAF.Agent); @@ -225,9 +225,9 @@ public Resource createOwnerAuthorization(Resource accessTo, Resource agent) */ protected Service getEndUserService() { - return getApplication().canAs(AdminApplication.class) ? - getApplication().as(AdminApplication.class).getEndUserApplication().getService() : - getApplication().getService(); + return getDataspace().canAs(AdminDataspace.class) ? + getDataspace().as(AdminDataspace.class).getEndUserDataspace().getService() : + getDataspace().getService(); } /** @@ -264,7 +264,7 @@ public Request getRequest() * * @return application resource */ - public EndUserApplication getApplication() + public EndUserDataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/acl/AccessRequest.java b/src/main/java/com/atomgraph/linkeddatahub/resource/acl/AccessRequest.java index 93687800af..acbe03a3fe 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/acl/AccessRequest.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/acl/AccessRequest.java @@ -17,8 +17,8 @@ package com.atomgraph.linkeddatahub.resource.acl; import com.atomgraph.core.exception.ConfigurationException; -import static com.atomgraph.linkeddatahub.apps.model.AdminApplication.AUTHORIZATION_REQUEST_PATH; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import static com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace.AUTHORIZATION_REQUEST_PATH; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.security.AgentContext; import com.atomgraph.linkeddatahub.server.util.Skolemizer; @@ -62,7 +62,7 @@ public class AccessRequest private static final Logger log = LoggerFactory.getLogger(AccessRequest.class); - private final EndUserApplication application; + private final EndUserDataspace application; private final Optional agentContext; private final String emailSubject; private final String emailText; @@ -78,16 +78,16 @@ public class AccessRequest * @param servletConfig servlet configuration */ @Inject - public AccessRequest(com.atomgraph.linkeddatahub.apps.model.Application application, Optional agentContext, + public AccessRequest(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, Optional agentContext, com.atomgraph.linkeddatahub.Application system, @Context ServletConfig servletConfig) { if (log.isDebugEnabled()) log.debug("Constructing {}", getClass()); - if (!application.canAs(EndUserApplication.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); - this.application = application.as(EndUserApplication.class); + if (!application.canAs(EndUserDataspace.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); + this.application = application.as(EndUserDataspace.class); this.agentContext = agentContext; this.system = system; - authRequestContainerUriBuilder = this.application.getAdminApplication().getUriBuilder().path(AUTHORIZATION_REQUEST_PATH); + authRequestContainerUriBuilder = this.application.getAdminDataspace().getUriBuilder().path(AUTHORIZATION_REQUEST_PATH); emailSubject = servletConfig.getServletContext().getInitParameter(LDHC.requestAccessEMailSubject.getURI()); if (emailSubject == null) throw new InternalServerErrorException(new ConfigurationException(LDHC.requestAccessEMailSubject)); @@ -133,7 +133,6 @@ public Response post(Model model) String humanReadableName = getAgentsHumanReadableName(getAgentContext().get().getAgent()); String accessRequestLabel = humanReadableName != null ? "Access request by " + humanReadableName : null; // TO-DO: localize the string - Resource agentGroup = authorization.getPropertyResourceValue(ACL.agentGroup); Resource accessTo = authorization.getPropertyResourceValue(ACL.accessTo); Resource accessToClass = authorization.getPropertyResourceValue(ACL.accessToClass); @@ -154,7 +153,6 @@ public Response post(Model model) modeIt.close(); } - if (agentGroup != null) accessRequest.addProperty(LACL.requestAgentGroup, agentGroup); if (accessTo != null) accessRequest.addProperty(LACL.requestAccessTo, accessTo); if (accessToClass != null) accessRequest.addProperty(LACL.requestAccessToClass, accessToClass); @@ -176,7 +174,7 @@ public Response post(Model model) new Skolemizer(graphUri.toString()).apply(requestModel); // store access request in the admin service - getSystem().getServiceContext(getApplication().getAdminApplication().getService()).getGraphStoreClient().add(graphUri.toString(), requestModel); + getSystem().getServiceContext(getDataspace().getAdminDataspace().getService()).getGraphStoreClient().add(graphUri.toString(), requestModel); } return Response.ok().build(); @@ -208,7 +206,7 @@ public String getAgentsHumanReadableName(Agent agent) * * @return end-user application */ - public EndUserApplication getApplication() + public EndUserDataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/admin/ClearOntology.java b/src/main/java/com/atomgraph/linkeddatahub/resource/admin/ClearOntology.java index 9693e0264b..89ba37d23d 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/admin/ClearOntology.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/admin/ClearOntology.java @@ -16,8 +16,8 @@ */ package com.atomgraph.linkeddatahub.resource.admin; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.server.filter.response.CacheInvalidationFilter; import com.atomgraph.linkeddatahub.server.util.OntologyRepository; import java.net.URI; @@ -46,7 +46,7 @@ public class ClearOntology private static final Logger log = LoggerFactory.getLogger(ClearOntology.class); - private final com.atomgraph.linkeddatahub.apps.model.Application application; + private final com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application; private final com.atomgraph.linkeddatahub.Application system; /** @@ -56,7 +56,7 @@ public class ClearOntology * @param system system application */ @Inject - public ClearOntology(com.atomgraph.linkeddatahub.apps.model.Application application, com.atomgraph.linkeddatahub.Application system) + public ClearOntology(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system) { this.application = application; this.system = system; @@ -80,24 +80,24 @@ public Response post(@FormParam("uri") String ontologyURI, @HeaderParam("Referer { // resolve both apps regardless of which one the request matched: /clear is admin, but Settings // delegates here on the end-user app (its PATCH origin), and both backends need purging either way - final EndUserApplication endUserApp; - final AdminApplication adminApp; - if (getApplication().canAs(AdminApplication.class)) + final EndUserDataspace endUserApp; + final AdminDataspace adminApp; + if (getDataspace().canAs(AdminDataspace.class)) { - adminApp = getApplication().as(AdminApplication.class); - endUserApp = adminApp.getEndUserApplication(); + adminApp = getDataspace().as(AdminDataspace.class); + endUserApp = adminApp.getEndUserDataspace(); } else { - endUserApp = getApplication().as(EndUserApplication.class); - adminApp = endUserApp.getAdminApplication(); + endUserApp = getDataspace().as(EndUserDataspace.class); + adminApp = endUserApp.getAdminDataspace(); } OntologyRepository repository = getSystem().getRepository(endUserApp); // The request-scoped app is a snapshot ApplicationFilter captured before Settings.updateApp swapped // the context dataset copy-on-write, so on a PATCH /settings that just added an ldh:import its import // set is stale. Re-read from the current dataspace model, which reads the volatile contextDataset fresh - com.atomgraph.linkeddatahub.apps.model.Application currentApp = getSystem().getDataspaceModel(endUserApp).getResource(endUserApp.getURI()).as(com.atomgraph.linkeddatahub.apps.model.Application.class); + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace currentApp = getSystem().getDataspaceModel(endUserApp).getResource(endUserApp.getURI()).as(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class); // A package's ontology becomes editable by being copied into this application's own ontologies // container. Above the cache guard on purpose: the guard skips everything when the ontology was never @@ -227,7 +227,7 @@ public void xkeyPurge(URI proxyURI, String tag) * * @return application resource */ - public com.atomgraph.linkeddatahub.apps.model.Application getApplication() + public com.atomgraph.linkeddatahub.dataspaces.model.Dataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/admin/SignUp.java b/src/main/java/com/atomgraph/linkeddatahub/resource/admin/SignUp.java index 8931093a1b..82d7d7736c 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/admin/SignUp.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/admin/SignUp.java @@ -21,8 +21,8 @@ import jakarta.ws.rs.core.Request; import com.atomgraph.core.MediaTypes; import com.atomgraph.core.exception.ConfigurationException; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.listener.EMailListener; import com.atomgraph.linkeddatahub.server.filter.response.CacheInvalidationFilter; @@ -145,7 +145,7 @@ public class SignUp extends DocumentHierarchyGraphStoreImpl // TO-DO: move to AuthenticationExceptionMapper and handle as state instead of URI resource? @Inject public SignUp(@Context Request request, @Context UriInfo uriInfo, MediaTypes mediaTypes, - com.atomgraph.linkeddatahub.apps.model.Application application, Optional ontology, Optional service, + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, Optional ontology, Optional service, @Context SecurityContext securityContext, Optional agentContext, @Context Providers providers, com.atomgraph.linkeddatahub.Application system, @Context ServletConfig servletConfig, @Context HttpHeaders httpHeaders) @@ -153,8 +153,8 @@ public SignUp(@Context Request request, @Context UriInfo uriInfo, MediaTypes med super(request, uriInfo, mediaTypes, application, ontology, service, securityContext, agentContext, providers, system, httpHeaders); if (log.isDebugEnabled()) log.debug("Constructing {}", getClass()); - if (!application.canAs(AdminApplication.class)) // we are supposed to be in the admin app - throw new IllegalStateException("Application cannot be cast to lapp:AdminApplication"); + if (!application.canAs(AdminDataspace.class)) // we are supposed to be in the admin app + throw new IllegalStateException("Dataspace cannot be cast to lds:AdminDataspace"); try (InputStream countries = servletConfig.getServletContext().getResourceAsStream(COUNTRY_DATASET_PATH)) { @@ -488,12 +488,12 @@ public void sendEmail(Resource agent, LocalDate certExpires, byte[] keyStoreByte // labels and links need to come from the end-user app MessageBuilder builder = getSystem().getMessageBuilder(). subject(String.format(getEmailSubject(), - getEndUserApplication().getProperty(DCTerms.title).getString(), + getEndUserDataspace().getProperty(DCTerms.title).getString(), fullName)). to(mbox, fullName). textBodyPart(String.format(getEmailText(), - getEndUserApplication().getProperty(DCTerms.title).getString(), - getEndUserApplication().getBase(), + getEndUserDataspace().getProperty(DCTerms.title).getString(), + getEndUserDataspace().getBase(), agent.getURI(), certExpires.format(DateTimeFormatter.ISO_LOCAL_DATE))). byteArrayBodyPart(keyStoreBytes, PKCS12_MEDIA_TYPE.toString(), keyStoreFileName); @@ -508,12 +508,12 @@ public void sendEmail(Resource agent, LocalDate certExpires, byte[] keyStoreByte * * @return end-user application */ - public EndUserApplication getEndUserApplication() + public EndUserDataspace getEndUserDataspace() { - if (getApplication().canAs(EndUserApplication.class)) - return getApplication().as(EndUserApplication.class); + if (getDataspace().canAs(EndUserDataspace.class)) + return getDataspace().as(EndUserDataspace.class); else - return getApplication().as(AdminApplication.class).getEndUserApplication(); + return getDataspace().as(AdminDataspace.class).getEndUserDataspace(); } /** @@ -523,7 +523,7 @@ public EndUserApplication getEndUserApplication() */ public Service getAgentService() { - return getApplication().getService(); + return getDataspace().getService(); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/AuthorizeBase.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/AuthorizeBase.java index 2a9abafcdd..a750bcc7fb 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/AuthorizeBase.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/AuthorizeBase.java @@ -16,9 +16,9 @@ */ package com.atomgraph.linkeddatahub.resource.oauth2; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import java.math.BigInteger; import java.net.URI; import java.security.SecureRandom; @@ -48,7 +48,7 @@ public abstract class AuthorizeBase public static final String REFERER_PARAM_NAME = "referer"; private final HttpServletRequest httpServletRequest; - private final Application application; + private final Dataspace application; private final com.atomgraph.linkeddatahub.Application system; private final String clientID; @@ -60,9 +60,9 @@ public abstract class AuthorizeBase * @param system JAX-RS application * @param clientID OAuth client ID */ - public AuthorizeBase(HttpServletRequest httpServletRequest, Application application, com.atomgraph.linkeddatahub.Application system, String clientID) + public AuthorizeBase(HttpServletRequest httpServletRequest, Dataspace application, com.atomgraph.linkeddatahub.Application system, String clientID) { - if (!application.canAs(EndUserApplication.class)) + if (!application.canAs(EndUserDataspace.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); this.httpServletRequest = httpServletRequest; @@ -150,12 +150,12 @@ public UriBuilder getAuthorizeUriBuilder(URI endpoint, String clientID, String r * * @return application resource */ - public EndUserApplication getEndUserApplication() + public EndUserDataspace getEndUserDataspace() { - if (getApplication().canAs(EndUserApplication.class)) - return getApplication().as(EndUserApplication.class); + if (getDataspace().canAs(EndUserDataspace.class)) + return getDataspace().as(EndUserDataspace.class); else - return getApplication().as(AdminApplication.class).getEndUserApplication(); + return getDataspace().as(AdminDataspace.class).getEndUserDataspace(); } /** @@ -173,7 +173,7 @@ public HttpServletRequest getHttpServletRequest() * * @return application resource */ - public Application getApplication() + public Dataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/LoginBase.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/LoginBase.java index 725faba7ac..7a83d870e7 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/LoginBase.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/LoginBase.java @@ -16,9 +16,9 @@ */package com.atomgraph.linkeddatahub.resource.oauth2; import com.atomgraph.core.exception.ConfigurationException; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.listener.EMailListener; import com.atomgraph.linkeddatahub.model.Service; import static com.atomgraph.linkeddatahub.resource.admin.SignUp.AGENT_PATH; @@ -88,7 +88,7 @@ public abstract class LoginBase private final UriInfo uriInfo; private final HttpHeaders httpHeaders; - private final com.atomgraph.linkeddatahub.apps.model.Application application; + private final com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application; private final com.atomgraph.linkeddatahub.Application system; private final String emailSubject; private final String emailText; @@ -108,11 +108,11 @@ public abstract class LoginBase * @param clientSecret OAuth client secret; */ public LoginBase(@Context Request request, @Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, - com.atomgraph.linkeddatahub.apps.model.Application application, + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system, @Context ServletConfig servletConfig, String clientID, String clientSecret) { - if (!application.canAs(EndUserApplication.class)) + if (!application.canAs(EndUserDataspace.class)) throw new IllegalStateException("The " + getClass() + " endpoint is only available on end-user applications"); this.uriInfo = uriInfo; @@ -202,11 +202,11 @@ public Response get(@QueryParam("code") String code, @QueryParam("state") String Optional mbox = email.map(e -> "mailto:" + e).map(ResourceFactory::createResource); Model accountModel = ModelFactory.createDefaultModel(); - URI userAccountGraphUri = getAdminApplication().getUriBuilder().path(ACCOUNT_PATH).path("{slug}/").build(UUID.randomUUID().toString()); + URI userAccountGraphUri = getAdminDataspace().getUriBuilder().path(ACCOUNT_PATH).path("{slug}/").build(UUID.randomUUID().toString()); createUserAccount(accountModel, userAccountGraphUri, - accountModel.createResource(getAdminApplication().getBaseURI().resolve(ACCOUNT_PATH).toString()), + accountModel.createResource(getAdminDataspace().getBaseURI().resolve(ACCOUNT_PATH).toString()), jwt.getSubject(), jwt.getIssuer(), Optional.ofNullable(userInfo.get("name")), @@ -223,11 +223,11 @@ public Response get(@QueryParam("code") String code, @QueryParam("state") String if (existingAgent.isEmpty()) { Model agentModel = ModelFactory.createDefaultModel(); - URI agentGraphUri = getAdminApplication().getUriBuilder().path(AGENT_PATH).path("{slug}/").build(UUID.randomUUID().toString()); + URI agentGraphUri = getAdminDataspace().getUriBuilder().path(AGENT_PATH).path("{slug}/").build(UUID.randomUUID().toString()); agent = createAgent(agentModel, agentGraphUri, - agentModel.createResource(getAdminApplication().getBaseURI().resolve(AGENT_PATH).toString()), + agentModel.createResource(getAdminDataspace().getBaseURI().resolve(AGENT_PATH).toString()), Optional.ofNullable(userInfo.get("name")), Optional.ofNullable(userInfo.get("given_name")), Optional.ofNullable(userInfo.get("family_name")), @@ -249,12 +249,12 @@ public Response get(@QueryParam("code") String code, @QueryParam("state") String ban(agentSvcProxy, mbox.get().getURI()); Model authModel = ModelFactory.createDefaultModel(); - URI authGraphUri = getAdminApplication().getUriBuilder().path(AUTHORIZATION_PATH).path("{slug}/").build(UUID.randomUUID().toString()); + URI authGraphUri = getAdminDataspace().getUriBuilder().path(AUTHORIZATION_PATH).path("{slug}/").build(UUID.randomUUID().toString()); // creating authorization for the Agent document createAuthorization(authModel, authGraphUri, - accountModel.createResource(getAdminApplication().getBaseURI().resolve(AUTHORIZATION_PATH).toString()), + accountModel.createResource(getAdminDataspace().getBaseURI().resolve(AUTHORIZATION_PATH).toString()), agentGraphUri, userAccountGraphUri); new Skolemizer(authGraphUri.toString()).apply(authModel); @@ -264,7 +264,7 @@ public Response get(@QueryParam("code") String code, @QueryParam("state") String try { // purge agent lookup from proxy cache - URI adminSvcProxy = getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(); + URI adminSvcProxy = getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(); if (adminSvcProxy != null) ban(adminSvcProxy, jwt.getSubject()); // remove secretary WebID from cache @@ -489,12 +489,12 @@ public void sendEmail(Resource agent) throws MessagingException, UnsupportedEnco // labels and links need to come from the end-user app MessageBuilder builder = getSystem().getMessageBuilder(). subject(String.format(getEmailSubject(), - getEndUserApplication().getProperty(DCTerms.title).getString(), + getEndUserDataspace().getProperty(DCTerms.title).getString(), fullName)). to(mbox, fullName). textBodyPart(String.format(getEmailText(), - getEndUserApplication().getProperty(DCTerms.title).getString(), - getEndUserApplication().getBase(), + getEndUserDataspace().getProperty(DCTerms.title).getString(), + getEndUserDataspace().getBase(), agent.getURI())); if (getSystem().getNotificationAddress() != null) builder = builder.from(getSystem().getNotificationAddress()); @@ -555,12 +555,12 @@ public Response ban(URI proxyURI, String url) * * @return end-user application resource */ - public EndUserApplication getEndUserApplication() + public EndUserDataspace getEndUserDataspace() { - if (getApplication().canAs(EndUserApplication.class)) - return getApplication().as(EndUserApplication.class); + if (getDataspace().canAs(EndUserDataspace.class)) + return getDataspace().as(EndUserDataspace.class); else - return getApplication().as(AdminApplication.class).getEndUserApplication(); + return getDataspace().as(AdminDataspace.class).getEndUserDataspace(); } /** @@ -568,12 +568,12 @@ public EndUserApplication getEndUserApplication() * * @return admin application resource */ - public AdminApplication getAdminApplication() + public AdminDataspace getAdminDataspace() { - if (getApplication().canAs(AdminApplication.class)) - return getApplication().as(AdminApplication.class); + if (getDataspace().canAs(AdminDataspace.class)) + return getDataspace().as(AdminDataspace.class); else - return getApplication().as(EndUserApplication.class).getAdminApplication(); + return getDataspace().as(EndUserDataspace.class).getAdminDataspace(); } /** @@ -601,7 +601,7 @@ public com.atomgraph.linkeddatahub.Application getSystem() * * @return application resource */ - public Application getApplication() + public Dataspace getDataspace() { return application; } @@ -623,7 +623,7 @@ public HttpHeaders getHttpHeaders() */ public Service getAgentService() { - return getApplication().as(EndUserApplication.class).getAdminApplication().getService(); + return getDataspace().as(EndUserDataspace.class).getAdminDataspace().getService(); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Authorize.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Authorize.java index 5d3aecc519..c04c66aa91 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Authorize.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Authorize.java @@ -41,7 +41,7 @@ public class Authorize extends AuthorizeBase * @param system JAX-RS application */ @Inject - public Authorize(@Context HttpServletRequest httpServletRequest, com.atomgraph.linkeddatahub.apps.model.Application application, com.atomgraph.linkeddatahub.Application system) + public Authorize(@Context HttpServletRequest httpServletRequest, com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system) { super(httpServletRequest, application, system, (String)system.getProperty(Google.clientID.getURI())); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Login.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Login.java index cf497e9a59..a81ef8e65c 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Login.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/google/Login.java @@ -63,7 +63,7 @@ public class Login extends LoginBase */ @Inject public Login(@Context Request request, @Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, - com.atomgraph.linkeddatahub.apps.model.Application application, + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system, @Context ServletConfig servletConfig) { super(request, uriInfo, httpHeaders, application, system, servletConfig, diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Authorize.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Authorize.java index 838ec8240b..45157cbc65 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Authorize.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Authorize.java @@ -40,7 +40,7 @@ public class Authorize extends AuthorizeBase * @param system JAX-RS application */ @Inject - public Authorize(@Context HttpServletRequest httpServletRequest, com.atomgraph.linkeddatahub.apps.model.Application application, com.atomgraph.linkeddatahub.Application system) + public Authorize(@Context HttpServletRequest httpServletRequest, com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system) { super(httpServletRequest, application, system, (String)system.getProperty(ORCID.clientID.getURI())); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Login.java b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Login.java index d41d926811..4832f1cb73 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Login.java +++ b/src/main/java/com/atomgraph/linkeddatahub/resource/oauth2/orcid/Login.java @@ -69,7 +69,7 @@ public class Login extends LoginBase */ @Inject public Login(@Context Request request, @Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, - com.atomgraph.linkeddatahub.apps.model.Application application, + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, com.atomgraph.linkeddatahub.Application system, @Context ServletConfig servletConfig) { super(request, uriInfo, httpHeaders, application, system, servletConfig, diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/event/AuthorizationCreated.java b/src/main/java/com/atomgraph/linkeddatahub/server/event/AuthorizationCreated.java index 3b02124d24..d1d453861f 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/event/AuthorizationCreated.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/event/AuthorizationCreated.java @@ -16,7 +16,7 @@ */ package com.atomgraph.linkeddatahub.server.event; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import org.apache.jena.rdf.model.Resource; @@ -28,7 +28,7 @@ public class AuthorizationCreated { - private final Application app; + private final Dataspace app; private final GraphStoreClient gsc; private final Resource authorization; @@ -39,7 +39,7 @@ public class AuthorizationCreated * @param gsc Graph Store client * @param authorization associated authorization */ - public AuthorizationCreated(Application app, GraphStoreClient gsc, Resource authorization) + public AuthorizationCreated(Dataspace app, GraphStoreClient gsc, Resource authorization) { this.app = app; this.gsc = gsc; @@ -51,7 +51,7 @@ public AuthorizationCreated(Application app, GraphStoreClient gsc, Resource auth * * @return application resource */ - public Application getApplication() + public Dataspace getDataspace() { return app; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/factory/ApplicationFactory.java b/src/main/java/com/atomgraph/linkeddatahub/server/factory/ApplicationFactory.java index 3f112a08ea..784572993b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/factory/ApplicationFactory.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/factory/ApplicationFactory.java @@ -16,7 +16,7 @@ */ package com.atomgraph.linkeddatahub.server.factory; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.Context; import jakarta.ws.rs.ext.Provider; @@ -33,7 +33,7 @@ * @see com.atomgraph.linkeddatahub.server.model.impl.Dispatcher */ @Provider -public class ApplicationFactory implements Factory> +public class ApplicationFactory implements Factory> { private static final Logger log = LoggerFactory.getLogger(ApplicationFactory.class); @@ -41,13 +41,13 @@ public class ApplicationFactory implements Factory provide() + public Optional provide() { - return getApplication(); + return getDataspace(); } @Override - public void dispose(Optional t) + public void dispose(Optional t) { } @@ -56,9 +56,9 @@ public void dispose(Optional * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { - return (Optional)getContainerRequestContext().getProperty(LAPP.Application.getURI()); + return (Optional)getContainerRequestContext().getProperty(LDS.Dataspace.getURI()); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/factory/DatasetFactory.java b/src/main/java/com/atomgraph/linkeddatahub/server/factory/DatasetFactory.java index cd50882d14..f7f9d43752 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/factory/DatasetFactory.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/factory/DatasetFactory.java @@ -18,8 +18,8 @@ import jakarta.ws.rs.core.Context; import jakarta.ws.rs.ext.Provider; -import com.atomgraph.linkeddatahub.apps.model.Dataset; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataset; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.util.Optional; import jakarta.ws.rs.container.ContainerRequestContext; import org.glassfish.hk2.api.Factory; @@ -59,7 +59,7 @@ public void dispose(Optional t) */ public Optional getDataset() { - return (Optional)getContainerRequestContext().getProperty(LAPP.Dataset.getURI()); + return (Optional)getContainerRequestContext().getProperty(LDS.Dataset.getURI()); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/factory/ServiceFactory.java b/src/main/java/com/atomgraph/linkeddatahub/server/factory/ServiceFactory.java index d3e510bb6c..4326c5a4c2 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/factory/ServiceFactory.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/factory/ServiceFactory.java @@ -16,9 +16,9 @@ */ package com.atomgraph.linkeddatahub.server.factory; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import com.atomgraph.linkeddatahub.model.Service; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.util.Optional; import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.Context; @@ -59,7 +59,7 @@ public void dispose(Optional t) */ public Optional getService() { - Optional appOpt = (Optional)getContainerRequestContext().getProperty(LAPP.Application.getURI()); + Optional appOpt = (Optional)getContainerRequestContext().getProperty(LDS.Dataspace.getURI()); if (!appOpt.isPresent()) return Optional.empty(); diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/factory/UnwrappedApplicationFactory.java b/src/main/java/com/atomgraph/linkeddatahub/server/factory/UnwrappedApplicationFactory.java index 179550fc7a..0821ef3b21 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/factory/UnwrappedApplicationFactory.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/factory/UnwrappedApplicationFactory.java @@ -16,7 +16,7 @@ */ package com.atomgraph.linkeddatahub.server.factory; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import jakarta.inject.Inject; import jakarta.ws.rs.ext.Provider; import java.util.Optional; @@ -25,29 +25,29 @@ import org.slf4j.LoggerFactory; /** - * JAX-RS factory that unwraps Optional<Application> for direct injection. - * This allows resource constructors to inject Application directly while - * filters and providers can inject Optional<Application>. + * JAX-RS factory that unwraps Optional<Dataspace> for direct injection. + * This allows resource constructors to inject Dataspace directly while + * filters and providers can inject Optional<Dataspace>. * * @author Martynas Jusevičius {@literal } * @see ApplicationFactory */ @Provider -public class UnwrappedApplicationFactory implements Factory +public class UnwrappedApplicationFactory implements Factory { private static final Logger log = LoggerFactory.getLogger(UnwrappedApplicationFactory.class); - @Inject jakarta.inject.Provider> optionalApp; + @Inject jakarta.inject.Provider> optionalApp; @Override - public Application provide() + public Dataspace provide() { - Optional appOpt = optionalApp.get(); + Optional appOpt = optionalApp.get(); if (!appOpt.isPresent()) { - if (log.isErrorEnabled()) log.error("Application not present when unwrapping in UnwrappedApplicationFactory"); + if (log.isErrorEnabled()) log.error("Dataspace not present when unwrapping in UnwrappedApplicationFactory"); return null; // This should only happen if ApplicationFilter threw NotFoundException } @@ -55,7 +55,7 @@ public Application provide() } @Override - public void dispose(Application t) + public void dispose(Dataspace t) { } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ApplicationFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ApplicationFilter.java index c703b078ec..c5a997fdfc 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ApplicationFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ApplicationFilter.java @@ -17,7 +17,7 @@ package com.atomgraph.linkeddatahub.server.filter.request; import com.atomgraph.client.vocabulary.AC; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.writer.Mode; import java.io.IOException; import java.util.Collections; @@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory; /** - * Request filter that sets request attribute with name ldt:Application and current application as the value + * Request filter that sets request attribute with name lds:Dataspace and the current dataspace as the value * * @author Martynas Jusevičius {@literal } */ @@ -77,18 +77,18 @@ public void filter(ContainerRequestContext request) throws IOException if (appResource == null) { // Set empty Optional so response filters can safely check - request.setProperty(LAPP.Application.getURI(), Optional.empty()); - throw new NotFoundException("Request URI '" + request.getUriInfo().getAbsolutePath() + "' has not matched any lapp:Application"); + request.setProperty(LDS.Dataspace.getURI(), Optional.empty()); + throw new NotFoundException("Request URI '" + request.getUriInfo().getAbsolutePath() + "' has not matched any lds:Dataspace"); } // instead of InfModel, do faster explicit checks for subclasses and add rdf:type - if (!appResource.canAs(com.atomgraph.linkeddatahub.apps.model.Application.class) && - !appResource.canAs(com.atomgraph.linkeddatahub.apps.model.EndUserApplication.class) && - !appResource.canAs(com.atomgraph.linkeddatahub.apps.model.AdminApplication.class)) - throw new IllegalStateException("Resource <" + appResource + "> cannot be cast to lapp:Application"); + if (!appResource.canAs(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class) && + !appResource.canAs(com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace.class) && + !appResource.canAs(com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace.class)) + throw new IllegalStateException("Resource <" + appResource + "> cannot be cast to lds:Dataspace"); - com.atomgraph.linkeddatahub.apps.model.Application app = appResource.as(com.atomgraph.linkeddatahub.apps.model.Application.class); - request.setProperty(LAPP.Application.getURI(), Optional.of(app)); // wrap in Optional so response filters can handle missing applications + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app = appResource.as(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class); + request.setProperty(LDS.Dataspace.getURI(), Optional.of(app)); // wrap in Optional so response filters can handle missing applications // use the ?uri URL parameter to override the effective request URI if its URI value is relative to the app's base URI final URI requestURI; @@ -135,24 +135,24 @@ public void filter(ContainerRequestContext request) throws IOException throw new BadRequestException(ex); } else requestURI = request.getUriInfo().getRequestUri(); - request.setRequestUri(app.getBaseURI(), requestURI); // there's always ldt:base + request.setRequestUri(app.getBaseURI(), requestURI); // there's always a base URI // TO-DO: move Dataset logic to a separate ContainerRequestFilter? - Resource datasetResource = getSystem().matchDataset(LAPP.Dataset, request.getUriInfo().getAbsolutePath()); + Resource datasetResource = getSystem().matchDataset(LDS.Dataset, request.getUriInfo().getAbsolutePath()); if (datasetResource != null) { // instead of InfModel, do faster explicit checks for subclasses and add rdf:type - if (!datasetResource.canAs(com.atomgraph.linkeddatahub.apps.model.Dataset.class)) - throw new IllegalStateException("Resource <" + datasetResource + "> cannot be cast to lapp:Dataset"); + if (!datasetResource.canAs(com.atomgraph.linkeddatahub.dataspaces.model.Dataset.class)) + throw new IllegalStateException("Resource <" + datasetResource + "> cannot be cast to lds:Dataset"); - com.atomgraph.linkeddatahub.apps.model.Dataset dataset = datasetResource.as(com.atomgraph.linkeddatahub.apps.model.Dataset.class); - if (log.isDebugEnabled()) log.debug("Request URI <{}> has matched a lapp:Dataset <{}>", request.getUriInfo().getRequestUri(), dataset.getURI()); - request.setProperty(LAPP.Dataset.getURI(), Optional.of(dataset)); + com.atomgraph.linkeddatahub.dataspaces.model.Dataset dataset = datasetResource.as(com.atomgraph.linkeddatahub.dataspaces.model.Dataset.class); + if (log.isDebugEnabled()) log.debug("Request URI <{}> has matched a lds:Dataset <{}>", request.getUriInfo().getRequestUri(), dataset.getURI()); + request.setProperty(LDS.Dataset.getURI(), Optional.of(dataset)); } else { - if (log.isDebugEnabled()) log.debug("Request URI <{}> has not matched any lapp:Dataset", request.getUriInfo().getRequestUri()); - request.setProperty(LAPP.Dataset.getURI(), Optional.empty()); + if (log.isDebugEnabled()) log.debug("Request URI <{}> has not matched any lds:Dataset", request.getUriInfo().getRequestUri()); + request.setProperty(LDS.Dataset.getURI(), Optional.empty()); } } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthenticationFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthenticationFilter.java index e12c95587a..cf41f5cc6d 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthenticationFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthenticationFilter.java @@ -16,9 +16,9 @@ */ package com.atomgraph.linkeddatahub.server.filter.request; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.Dataset; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataset; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.client.SesameProtocolClient; import com.atomgraph.linkeddatahub.model.Service; import com.atomgraph.linkeddatahub.server.security.AgentContext; @@ -54,8 +54,8 @@ public abstract class AuthenticationFilter implements ContainerRequestFilter public static final String ON_BEHALF_OF = "On-Behalf-Of"; @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> app; - @Inject jakarta.inject.Provider> dataset; + @Inject jakarta.inject.Provider> app; + @Inject jakarta.inject.Provider> dataset; /** * Returns authentication scheme ID. @@ -71,7 +71,7 @@ public abstract class AuthenticationFilter implements ContainerRequestFilter * @param app currently matched application * @param request current request context */ - public abstract void login(com.atomgraph.linkeddatahub.apps.model.Application app, ContainerRequestContext request); + public abstract void login(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, ContainerRequestContext request); /** * Abstract method for logout logic. @@ -80,7 +80,7 @@ public abstract class AuthenticationFilter implements ContainerRequestFilter * @param app currently matched application * @param request current request context */ - public abstract void logout(com.atomgraph.linkeddatahub.apps.model.Application app, ContainerRequestContext request); + public abstract void logout(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, ContainerRequestContext request); /** * Authenticates the current request and returns the security context for the authenticated agent. @@ -100,7 +100,7 @@ public void filter(ContainerRequestContext request) throws IOException if (request.getSecurityContext().getUserPrincipal() != null) return; // skip filter if agent already authorized if (getDataset().isPresent()) return; // skip proxied dataspaces - //if (isLogoutForced(request, getScheme())) logout(getApplication(), request); + //if (isLogoutForced(request, getScheme())) logout(getDataspace(), request); final SecurityContext securityContext = authenticate(request); if (securityContext == null) return; // skip to the next filter if agent could not be retrieved with this one @@ -116,9 +116,9 @@ public void filter(ContainerRequestContext request) throws IOException */ protected Service getAgentService() { - return getApplication().get().canAs(EndUserApplication.class) ? - getApplication().get().as(EndUserApplication.class).getAdminApplication().getService() : - getApplication().get().getService(); + return getDataspace().get().canAs(EndUserDataspace.class) ? + getDataspace().get().as(EndUserDataspace.class).getAdminDataspace().getService() : + getDataspace().get().getService(); } /** @@ -187,7 +187,7 @@ protected Resource getResourceByPropertyValue(Model model, Property property, RD * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return app.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthorizationFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthorizationFilter.java index bce5c4575b..ec79ed621a 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthorizationFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthorizationFilter.java @@ -16,7 +16,7 @@ */ package com.atomgraph.linkeddatahub.server.filter.request; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.client.SesameProtocolClient; import com.atomgraph.linkeddatahub.server.exception.auth.AuthorizationException; import com.atomgraph.linkeddatahub.model.auth.Agent; @@ -83,8 +83,8 @@ public class AuthorizationFilter implements ContainerRequestFilter ); @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> app; - @Inject jakarta.inject.Provider> dataset; + @Inject jakarta.inject.Provider> app; + @Inject jakarta.inject.Provider> dataset; private ParameterizedSparqlString documentTypeQuery, documentOwnerQuery, aclQuery, ownerAclQuery; @@ -114,7 +114,7 @@ public void filter(ContainerRequestContext request) throws IOException return; } - if (getApplication().isPresent() && getApplication().get().isReadAllowed()) + if (getDataspace().isPresent() && getDataspace().get().isReadAllowed()) { if (request.getMethod().equals(HttpMethod.GET) || request.getMethod().equals(HttpMethod.HEAD)) // allow read-only methods { @@ -174,7 +174,7 @@ public Model authorize(ContainerRequestContext request, Resource agent, Resource QuerySolutionMap thisQsm = new QuerySolutionMap(); thisQsm.add(SPIN.THIS_VAR_NAME, accessTo); - ResultSetRewindable docTypesResult = loadResultSet(getApplication().get().getService(), getDocumentTypeQuery(), thisQsm); + ResultSetRewindable docTypesResult = loadResultSet(getDataspace().get().getService(), getDocumentTypeQuery(), thisQsm); // types that constrain the ACL query's acl:accessToClass matching: the document's own by default, or the parent // container's when a PUT creates a new (still typeless) document and authorization falls back to the parent ResultSetRewindable aclTypesResult = docTypesResult; @@ -191,7 +191,7 @@ public Model authorize(ContainerRequestContext request, Resource agent, Resource QuerySolutionMap parentQsm = new QuerySolutionMap(); parentQsm.add(SPIN.THIS_VAR_NAME, parent); - ResultSetRewindable parentTypesResult = loadResultSet(getApplication().get().getService(), getDocumentTypeQuery(), parentQsm); + ResultSetRewindable parentTypesResult = loadResultSet(getDataspace().get().getService(), getDocumentTypeQuery(), parentQsm); // the parent's types (not the typeless child's) must drive acl:accessToClass matching so the parent's // write authorizations still apply; assigned now so the outer finally closes it on any exit path aclTypesResult = parentTypesResult; @@ -213,7 +213,7 @@ public Model authorize(ContainerRequestContext request, Resource agent, Resource parentTypesResult.reset(); // rewind so the parent's types can be injected into the ACL query below } - ParameterizedSparqlString pss = getApplication().get().canAs(EndUserApplication.class) ? getACLQuery() : getOwnerACLQuery(); + ParameterizedSparqlString pss = getDataspace().get().canAs(EndUserDataspace.class) ? getACLQuery() : getOwnerACLQuery(); // the ACL query carries a fail-closed default VALUES ?Type { rdfs:Resource } (see web.xml); when the resource // (or its parent, on a PUT-create) has a type, override that block with the real types so acl:accessToClass // grants match. A typeless resource keeps the default, whose class no authorization uses, so it matches nothing. @@ -271,7 +271,7 @@ protected boolean isOwner(Resource accessTo, Resource agent) ParameterizedSparqlString pss = getDocumentOwnerQuery(); pss.setParams(qsm); - ResultSetRewindable ownerResult = loadResultSet(getApplication().get().getService(), getDocumentOwnerQuery(), qsm); // could use ASK query in principle + ResultSetRewindable ownerResult = loadResultSet(getDataspace().get().getService(), getDocumentOwnerQuery(), qsm); // could use ASK query in principle try { return ownerResult.hasNext() && agent.equals(ownerResult.next().getResource("owner")); @@ -378,9 +378,9 @@ public Resource createOwnerAuthorization(Model model, Resource accessTo, Resourc */ protected Service getAdminService() { - return getApplication().get().canAs(EndUserApplication.class) ? - getApplication().get().as(EndUserApplication.class).getAdminApplication().getService() : - getApplication().get().getService(); + return getDataspace().get().canAs(EndUserDataspace.class) ? + getDataspace().get().as(EndUserDataspace.class).getAdminDataspace().getService() : + getDataspace().get().getService(); } /** @@ -391,9 +391,9 @@ protected Service getAdminService() */ protected Resource getAdminBase() { - return getApplication().get().canAs(EndUserApplication.class) ? - getApplication().get().as(EndUserApplication.class).getAdminApplication().getBase() : - getApplication().get().getBase(); + return getDataspace().get().canAs(EndUserDataspace.class) ? + getDataspace().get().as(EndUserDataspace.class).getAdminDataspace().getBase() : + getDataspace().get().getBase(); } /** @@ -401,7 +401,7 @@ protected Resource getAdminBase() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return app.get(); } @@ -411,7 +411,7 @@ public Optional getApplicati * * @return optional dataset resource */ - public Optional getDataset() + public Optional getDataset() { return dataset.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/OntologyFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/OntologyFilter.java index b35f50a900..23f3bc554c 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/OntologyFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/OntologyFilter.java @@ -16,11 +16,11 @@ */ package com.atomgraph.linkeddatahub.server.filter.request; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.client.util.jena.PrefixGraphRepository; import com.atomgraph.linkeddatahub.server.util.ScopedGraphRepository; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.server.exception.OntologyException; import java.io.IOException; import java.net.URI; @@ -109,7 +109,7 @@ public void filter(ContainerRequestContext crc) throws IOException */ public Optional getOntology(ContainerRequestContext crc) { - Optional appOpt = getApplication(crc); + Optional appOpt = getDataspace(crc); if (!appOpt.isPresent()) return Optional.empty(); @@ -129,7 +129,7 @@ public Optional getOntology(ContainerRequestContext crc) * @param app application resource * @return ontology model */ - public OntModel getOntology(Application app) + public OntModel getOntology(Dataspace app) { if (app.getOntology() == null) return null; @@ -145,13 +145,13 @@ public OntModel getOntology(Application app) * @param uri ontology URI * @return ontology model */ - public OntModel getOntology(Application app, String uri) + public OntModel getOntology(Dataspace app, String uri) { - if (app == null) throw new IllegalArgumentException("Application cannot be null"); + if (app == null) throw new IllegalArgumentException("Dataspace cannot be null"); if (uri == null) throw new IllegalArgumentException("Ontology URI cannot be null"); - final PrefixGraphRepository repository = app.canAs(EndUserApplication.class) ? - getSystem().getRepository(app.as(EndUserApplication.class)) : getSystem().getRepository(); + final PrefixGraphRepository repository = app.canAs(EndUserDataspace.class) ? + getSystem().getRepository(app.as(EndUserDataspace.class)) : getSystem().getRepository(); // only assemble the closure if it is not already cached; the double check under the repository // lock ensures a single thread assembles it (loadOntology is a compound load + union build, not @@ -163,14 +163,14 @@ public OntModel getOntology(Application app, String uri) // nor cached is I/O - a remote fetch, or a read of this instance's own store - and nothing // about it needs the monitor, which exists to serialise the union build, not to hold every // other cold request behind a slow package server - List packages = getSystem().getPackageService().getPackages(app); + List packages = getSystem().getPackageService().getPackages(app); // A package ontology is not mapped for an application, so it resolves only once this application // holds its own copy. Materializing here rather than only on a settings change or a Clear is // what makes a package declared in the dataspace config work on a cold start, with no operator // step; it is idempotent, so every later miss costs one ASK per package - if (app.canAs(EndUserApplication.class)) - getSystem().getPackageService().materialize(packages, app.as(EndUserApplication.class)); + if (app.canAs(EndUserDataspace.class)) + getSystem().getPackageService().materialize(packages, app.as(EndUserDataspace.class)); List packageOntologies = getSystem().getPackageService().getOntologies(packages); @@ -329,9 +329,9 @@ public static void addDocumentModel(PrefixGraphRepository repository, String imp * @param crc request context * @return optional application resource */ - public Optional getApplication(ContainerRequestContext crc) + public Optional getDataspace(ContainerRequestContext crc) { - return ((Optional)crc.getProperty(LAPP.Application.getURI())); + return ((Optional)crc.getProperty(LDS.Dataspace.getURI())); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ProxyRequestFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ProxyRequestFilter.java index e299dcb7f3..bc3b98f9e8 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ProxyRequestFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/ProxyRequestFilter.java @@ -21,14 +21,14 @@ import com.atomgraph.client.vocabulary.AC; import com.atomgraph.core.exception.BadGatewayException; import com.atomgraph.core.util.ModelUtils; -import com.atomgraph.linkeddatahub.apps.model.Dataset; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataset; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import com.atomgraph.linkeddatahub.client.filter.auth.IDTokenDelegationFilter; import com.atomgraph.linkeddatahub.client.filter.auth.WebIDDelegationFilter; import com.atomgraph.linkeddatahub.server.security.AgentContext; import com.atomgraph.linkeddatahub.server.security.IDTokenSecurityContext; import com.atomgraph.linkeddatahub.server.security.WebIDSecurityContext; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -79,7 +79,7 @@ *
  • Explicit {@code ?uri=} query parameter pointing to an external URI (not relative to the * current application base). Requests relative to the app base are ignored here because * {@link ApplicationFilter} already rewrote the request URI for those.
  • - *
  • {@code lapp:Dataset} proxy: the request URI matched a URL-path pattern defined in the + *
  • {@code lds:Dataset} proxy: the request URI matched a URL-path pattern defined in the * system dataset configuration, and the dataset provides a proxied target URI.
  • * * ACL is not checked for proxy requests: the proxy is a global transport function, not a document @@ -272,8 +272,8 @@ protected Optional resolveTargetURI(ContainerRequestContext requestContext) URI proxyTarget = (URI) requestContext.getProperty(AC.uri.getURI()); if (proxyTarget != null) return Optional.of(proxyTarget); - // Case 2: lapp:Dataset proxy - Optional datasetOpt = (Optional) requestContext.getProperty(LAPP.Dataset.getURI()); + // Case 2: lds:Dataset proxy + Optional datasetOpt = (Optional) requestContext.getProperty(LDS.Dataset.getURI()); if (datasetOpt != null && datasetOpt.isPresent()) { URI proxied = datasetOpt.get().getProxied(requestContext.getUriInfo().getAbsolutePath()); diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/IDTokenFilterBase.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/IDTokenFilterBase.java index b25736f256..eb55ddfb16 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/IDTokenFilterBase.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/IDTokenFilterBase.java @@ -16,9 +16,9 @@ */ package com.atomgraph.linkeddatahub.server.filter.request.auth; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.filter.request.AuthenticationFilter; import com.atomgraph.linkeddatahub.server.security.IDTokenSecurityContext; @@ -163,8 +163,8 @@ public String getScheme() public void filter(ContainerRequestContext request) throws IOException { if (request.getSecurityContext().getUserPrincipal() != null) return; // skip filter if agent already authorized - if (!getApplication().isPresent()) return; // skip if no application matched - if (!getApplication().get().canAs(EndUserApplication.class) && !getApplication().get().canAs(AdminApplication.class)) return; // skip "primitive" apps + if (!getDataspace().isPresent()) return; // skip if no application matched + if (!getDataspace().get().canAs(EndUserDataspace.class) && !getDataspace().get().canAs(AdminDataspace.class)) return; // skip "primitive" apps // do not verify token for auth endpoints as that will lead to redirect loops if (request.getUriInfo().getAbsolutePath().equals(getLoginURL())) return; @@ -247,14 +247,14 @@ protected String getJWTToken(ContainerRequestContext request) } @Override - public void login(Application app, ContainerRequestContext request) + public void login(Dataspace app, ContainerRequestContext request) { Response response = Response.seeOther(getAuthorizeURL()).build(); throw new WebApplicationException(response); } @Override - public void logout(Application app, ContainerRequestContext request) + public void logout(Dataspace app, ContainerRequestContext request) { Cookie cookie = request.getCookies().get(COOKIE_NAME); if (cookie != null) @@ -310,12 +310,12 @@ public DecodedJWT refreshIDToken(String refreshToken) * * @return admin application resource */ - public AdminApplication getAdminApplication() + public AdminDataspace getAdminDataspace() { - if (getApplication().get().canAs(EndUserApplication.class)) - return getApplication().get().as(EndUserApplication.class).getAdminApplication(); + if (getDataspace().get().canAs(EndUserDataspace.class)) + return getDataspace().get().as(EndUserDataspace.class).getAdminDataspace(); else - return getApplication().get().as(AdminApplication.class); + return getDataspace().get().as(AdminDataspace.class); } /** diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/WebIDFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/WebIDFilter.java index aa93344f8c..6716ba037b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/WebIDFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/request/auth/WebIDFilter.java @@ -19,7 +19,7 @@ import com.atomgraph.linkeddatahub.server.filter.request.AuthenticationFilter; import com.atomgraph.core.MediaTypes; import com.atomgraph.core.io.ModelProvider; -import com.atomgraph.linkeddatahub.apps.model.Application; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.exception.auth.webid.InvalidWebIDPublicKeyException; import com.atomgraph.linkeddatahub.server.exception.auth.webid.WebIDLoadingException; @@ -369,13 +369,13 @@ public jakarta.ws.rs.core.MediaType[] getAcceptableMediaTypes() } @Override - public void login(Application app, ContainerRequestContext request) + public void login(Dataspace app, ContainerRequestContext request) { throw new UnsupportedOperationException("Not supported yet."); // login is controlled by the browser } @Override - public void logout(Application app, ContainerRequestContext request) + public void logout(Dataspace app, ContainerRequestContext request) { throw new UnsupportedOperationException("Not supported yet."); // logout not really possible with HTTP certificates } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/CacheInvalidationFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/CacheInvalidationFilter.java index 26536ddd8c..403e1f2ab4 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/CacheInvalidationFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/CacheInvalidationFilter.java @@ -16,8 +16,8 @@ */ package com.atomgraph.linkeddatahub.server.filter.response; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import java.io.IOException; import java.net.URI; import jakarta.annotation.Priority; @@ -54,68 +54,68 @@ public class CacheInvalidationFilter implements ContainerResponseFilter public static final String HEADER_NAME = "X-Escaped-Request-URI"; @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> app; + @Inject jakarta.inject.Provider> app; @Override public void filter(ContainerRequestContext req, ContainerResponseContext resp) throws IOException { // If no application was matched (e.g., non-existent dataspace or request scope unavailable), skip cache invalidation - Optional application = getApplication(); + Optional application = getDataspace(); if (application == null || !application.isPresent()) return; if (req.getMethod().equals(HttpMethod.POST) && resp.getHeaderString(HttpHeaders.LOCATION) != null) { URI location = URI.create(resp.getHeaderString(HttpHeaders.LOCATION)); URI parentURI = location.resolve("..").normalize(); - URI relativeParentURI = getApplication().get().getBaseURI().relativize(parentURI); + URI relativeParentURI = getDataspace().get().getBaseURI().relativize(parentURI); banIfNotNull(getSystem().getFrontendProxy(), location.toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), location.toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), location.toString()); // ban URI from authorization query results - banIfNotNull(getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(), location.toString()); + banIfNotNull(getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(), location.toString()); // ban parent resource URI in order to avoid stale children data in containers banIfNotNull(getSystem().getFrontendProxy(), parentURI.toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), parentURI.toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), parentURI.toString()); if (!relativeParentURI.toString().isEmpty()) // URIs can be relative in queries { banIfNotNull(getSystem().getFrontendProxy(), relativeParentURI.toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), relativeParentURI.toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), relativeParentURI.toString()); } } if (Set.of(HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE, HttpMethod.PATCH).contains(req.getMethod())) { // ban all admin. entries when the admin dataset is changed - not perfect, but works - if (!getAdminApplication().getBaseURI().relativize(req.getUriInfo().getAbsolutePath()).isAbsolute()) // URL is relative to the admin app's base URI + if (!getAdminDataspace().getBaseURI().relativize(req.getUriInfo().getAbsolutePath()).isAbsolute()) // URL is relative to the admin app's base URI { - banIfNotNull(getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(), getAdminApplication().getBaseURI().toString()); - banIfNotNull(getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(), "foaf:Agent"); // queries use prefixed names instead of absolute URIs - banIfNotNull(getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(), "acl:AuthenticatedAgent"); + banIfNotNull(getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(), getAdminDataspace().getBaseURI().toString()); + banIfNotNull(getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(), "foaf:Agent"); // queries use prefixed names instead of absolute URIs + banIfNotNull(getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(), "acl:AuthenticatedAgent"); } if (req.getUriInfo().getAbsolutePath().toString().endsWith("/")) { banIfNotNull(getSystem().getFrontendProxy(), req.getUriInfo().getAbsolutePath().toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), req.getUriInfo().getAbsolutePath().toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), req.getUriInfo().getAbsolutePath().toString()); // ban URI from authorization query results - banIfNotNull(getSystem().getServiceContext(getAdminApplication().getService()).getBackendProxy(), req.getUriInfo().getAbsolutePath().toString()); + banIfNotNull(getSystem().getServiceContext(getAdminDataspace().getService()).getBackendProxy(), req.getUriInfo().getAbsolutePath().toString()); // ban parent document URIs (those that have a trailing slash) in order to avoid stale children data in containers - if (!req.getUriInfo().getAbsolutePath().equals(getApplication().get().getBaseURI())) + if (!req.getUriInfo().getAbsolutePath().equals(getDataspace().get().getBaseURI())) { URI parentURI = req.getUriInfo().getAbsolutePath().resolve("..").normalize(); - URI relativeParentURI = getApplication().get().getBaseURI().relativize(parentURI); + URI relativeParentURI = getDataspace().get().getBaseURI().relativize(parentURI); // ban parent resource URI in order to avoid stale children data in containers banIfNotNull(getSystem().getFrontendProxy(), parentURI.toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), parentURI.toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), parentURI.toString()); if (!relativeParentURI.toString().isEmpty()) // URIs can be relative in queries { banIfNotNull(getSystem().getFrontendProxy(), relativeParentURI.toString()); - banIfNotNull(getSystem().getServiceContext(getApplication().get().getService()).getBackendProxy(), relativeParentURI.toString()); + banIfNotNull(getSystem().getServiceContext(getDataspace().get().getService()).getBackendProxy(), relativeParentURI.toString()); } } } @@ -167,13 +167,13 @@ public Response ban(URI proxyURI, String url) * * @return admin application resource */ - public AdminApplication getAdminApplication() + public AdminDataspace getAdminDataspace() { - com.atomgraph.linkeddatahub.apps.model.Application application = getApplication().get(); - if (application.canAs(EndUserApplication.class)) - return application.as(EndUserApplication.class).getAdminApplication(); + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application = getDataspace().get(); + if (application.canAs(EndUserDataspace.class)) + return application.as(EndUserDataspace.class).getAdminDataspace(); else - return application.as(AdminApplication.class); + return application.as(AdminDataspace.class); } /** @@ -181,7 +181,7 @@ public AdminApplication getAdminApplication() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return app.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/ResponseHeadersFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/ResponseHeadersFilter.java index 9ef9495233..6b5136c849 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/ResponseHeadersFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/ResponseHeadersFilter.java @@ -18,19 +18,18 @@ import com.atomgraph.client.util.HTMLMediaTypePredicate; import com.atomgraph.client.vocabulary.AC; -import com.atomgraph.server.vocabulary.LDT; import com.atomgraph.core.vocabulary.SD; import com.atomgraph.linkeddatahub.server.util.LanguageNegotiator; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.Dataset; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataset; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.model.impl.Dispatcher; import com.atomgraph.linkeddatahub.server.model.impl.DocumentHierarchyGraphStoreImpl; import com.atomgraph.linkeddatahub.server.security.AuthorizationContext; import com.atomgraph.linkeddatahub.server.util.Link; import com.atomgraph.linkeddatahub.vocabulary.ACL; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; import com.atomgraph.linkeddatahub.vocabulary.LDH; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.writer.TimeMapWriter; import java.io.IOException; import java.net.URI; @@ -59,7 +58,7 @@ public class ResponseHeadersFilter implements ContainerResponseFilter private static final Logger log = LoggerFactory.getLogger(ResponseHeadersFilter.class); @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> app; + @Inject jakarta.inject.Provider> app; @Inject jakarta.inject.Provider> dataset; @Inject jakarta.inject.Provider> authorizationContext; @@ -77,7 +76,7 @@ public void filter(ContainerRequestContext request, ContainerResponseContext res // its literals carry their own tags and none is dropped - so it is intended for all language audiences, which RFC 9110 // spells as no Content-Language at all. Labelling it would also contradict its own Vary, which carries no // Accept-Language dimension for exactly the same reason - if (response.hasEntity() && response.getMediaType() != null && getApplication().isPresent() && new HTMLMediaTypePredicate().test(response.getMediaType())) + if (response.hasEntity() && response.getMediaType() != null && getDataspace().isPresent() && new HTMLMediaTypePredicate().test(response.getMediaType())) response.getHeaders().putSingle(HttpHeaders.CONTENT_LANGUAGE, LanguageNegotiator.publishedTag(request.getAcceptableLanguages(), getSystem().getSupportedLanguages())); @@ -115,14 +114,14 @@ public void filter(ContainerRequestContext request, ContainerResponseContext res response.getHeaders().add(HttpHeaders.LINK, new Link(request.getUriInfo().getBaseUriBuilder().path(Dispatcher.class, "getSPARQLEndpoint").build(), SD.endpoint.getURI(), null)); // Only add application-specific links if application is present and this is not a proxy request - if (!isProxyRequest && getApplication().isPresent()) + if (!isProxyRequest && getDataspace().isPresent()) { - Application application = getApplication().get(); - // add Link rel=lapp:application - response.getHeaders().add(HttpHeaders.LINK, new Link(URI.create(application.getURI()), LAPP.application.getURI(), null)); - // add Link rel=ldt:ontology, if the ontology URI is specified + Dataspace application = getDataspace().get(); + // add Link rel=lds:dataspace + response.getHeaders().add(HttpHeaders.LINK, new Link(URI.create(application.getURI()), LDS.dataspace.getURI(), null)); + // add Link rel=lds:ontology, if the ontology URI is specified if (application.getOntology() != null) - response.getHeaders().add(HttpHeaders.LINK, new Link(URI.create(application.getOntology().getURI()), LDT.ontology.getURI(), null)); + response.getHeaders().add(HttpHeaders.LINK, new Link(URI.create(application.getOntology().getURI()), LDS.ontology.getURI(), null)); // add Memento (RFC 7089) hypermedia, if the document is versioned if (getSystem().getGraphVersioningService().getRepository(application.getURI()).isPresent() && request.getUriInfo().getMatchedResources().stream().anyMatch(DocumentHierarchyGraphStoreImpl.class::isInstance)) @@ -181,7 +180,7 @@ public com.atomgraph.linkeddatahub.Application getSystem() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return app.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/VersioningFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/VersioningFilter.java index 0711a65842..db78546f25 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/VersioningFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/VersioningFilter.java @@ -52,7 +52,7 @@ public class VersioningFilter implements ContainerResponseFilter public static final Set WRITE_METHODS = Set.of(HttpMethod.POST, HttpMethod.PUT, HttpMethod.PATCH, HttpMethod.DELETE); @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> app; + @Inject jakarta.inject.Provider> app; @Override public void filter(ContainerRequestContext request, ContainerResponseContext response) throws IOException @@ -61,7 +61,7 @@ public void filter(ContainerRequestContext request, ContainerResponseContext res if (response.getStatusInfo().getFamily() != Response.Status.Family.SUCCESSFUL) return; // excludes the PUT 308 redirect and error responses if (request.getProperty(AC.uri.getURI()) != null) return; // proxied request — not a local document write - Optional application = getApplication(); + Optional application = getDataspace(); if (application == null || application.isEmpty()) return; // only document graphs are versioned — literal-path resources (SPARQL endpoint, settings, ACL access, sign-up, packages) are not @@ -93,7 +93,7 @@ public com.atomgraph.linkeddatahub.Application getSystem() * * @return optional application */ - public Optional getApplication() + public Optional getDataspace() { return app.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/XsltExecutableFilter.java b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/XsltExecutableFilter.java index 4af3a664e1..88900a6189 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/XsltExecutableFilter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/filter/response/XsltExecutableFilter.java @@ -85,7 +85,7 @@ public class XsltExecutableFilter implements ContainerResponseFilter private static final Logger log = LoggerFactory.getLogger(XsltExecutableFilter.class); @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> application; + @Inject jakarta.inject.Provider> application; @Context UriInfo uriInfo; @Context ServletContext servletContext; @@ -98,12 +98,12 @@ public void filter(ContainerRequestContext req, ContainerResponseContext resp) t (resp.getMediaType().isCompatible(MediaType.TEXT_HTML_TYPE) || resp.getMediaType().isCompatible(MediaType.APPLICATION_XHTML_XML_TYPE))) { URI stylesheet = null; - if (getApplication().isPresent() && getApplication().get().getStylesheet() != null) - stylesheet = URI.create(getApplication().get().getStylesheet().getURI()); + if (getDataspace().isPresent() && getDataspace().get().getStylesheet() != null) + stylesheet = URI.create(getDataspace().get().getStylesheet().getURI()); if (stylesheet != null) { - List packages = getSystem().getPackageService().getPackageURIs(getApplication().get()); + List packages = getSystem().getPackageService().getPackageURIs(getDataspace().get()); ClientStylesheetService stylesheetService = getSystem().getClientStylesheetService(); if (packages.isEmpty()) req.setProperty(AC.stylesheet.getURI(), getXsltExecutable(stylesheet)); @@ -112,7 +112,7 @@ public void filter(ContainerRequestContext req, ContainerResponseContext resp) t // server-side composition is never withheld: a declarative import takes effect on the // next request, and it is the only rendering an instance whose compiler is unreachable // will ever get - req.setProperty(AC.stylesheet.getURI(), getXsltExecutable(getApplication().get(), stylesheet, packages)); + req.setProperty(AC.stylesheet.getURI(), getXsltExecutable(getDataspace().get(), stylesheet, packages)); if (stylesheetService != null) { @@ -121,7 +121,7 @@ public void filter(ContainerRequestContext req, ContainerResponseContext resp) t // until the composed stylesheet exists the client renders without the package, as it // always has; compiling one closes that window rather than opening it if (stylesheetService.isPublished(key)) req.setProperty(LDH.clientStylesheet.getURI(), stylesheetService.getPublicPath(key)); - else stylesheetService.buildAsync(key, getSystem().getPackageService().getStylesheets(getApplication().get())); + else stylesheetService.buildAsync(key, getSystem().getPackageService().getStylesheets(getDataspace().get())); } } } @@ -140,7 +140,7 @@ public void filter(ContainerRequestContext req, ContainerResponseContext resp) t * @param packages imported package URIs * @return XSLT executable */ - public XsltExecutable getXsltExecutable(com.atomgraph.linkeddatahub.apps.model.Application app, URI stylesheet, List packages) + public XsltExecutable getXsltExecutable(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, URI stylesheet, List packages) { try { @@ -209,7 +209,7 @@ public record StylesheetModule(URI uri, Document doc) { } * @throws SAXException XML parsing error * @throws TransformerException XML parsing or serialization error */ - public Composition getComposition(com.atomgraph.linkeddatahub.apps.model.Application app, URI stylesheet, List packages) throws IOException, ParserConfigurationException, SAXException, TransformerException + public Composition getComposition(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, URI stylesheet, List packages) throws IOException, ParserConfigurationException, SAXException, TransformerException { List hrefs = getSystem().getPackageService().getStylesheets(app).stream().map(URI::toString).collect(Collectors.toList()); URI entryURI = getPublicURI(app, stylesheet); @@ -385,7 +385,7 @@ public boolean appendImports(Document doc, List imports) * @return public stylesheet URL * @throws MalformedURLException URL error */ - public URI getPublicURI(com.atomgraph.linkeddatahub.apps.model.Application app, URI stylesheet) throws MalformedURLException + public URI getPublicURI(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app, URI stylesheet) throws MalformedURLException { if ("http".equals(stylesheet.getScheme()) || "https".equals(stylesheet.getScheme())) return stylesheet; @@ -602,7 +602,7 @@ public com.atomgraph.linkeddatahub.Application getSystem() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return application.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/io/ValidatingModelProvider.java b/src/main/java/com/atomgraph/linkeddatahub/server/io/ValidatingModelProvider.java index 2bc284e7c7..65bdcfb71d 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/io/ValidatingModelProvider.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/io/ValidatingModelProvider.java @@ -16,8 +16,8 @@ */ package com.atomgraph.linkeddatahub.server.io; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.security.AgentContext; @@ -82,7 +82,7 @@ public class ValidatingModelProvider extends com.atomgraph.server.io.ValidatingM @Context UriInfo uriInfo; @Context SecurityContext securityContext; - @Inject jakarta.inject.Provider> application; + @Inject jakarta.inject.Provider> application; @Inject com.atomgraph.linkeddatahub.Application system; @Inject jakarta.inject.Provider> agentContextProvider; @@ -231,18 +231,18 @@ public Resource processRead(Resource resource) // this logic really belongs in a } } - if (getApplication().isPresent() && getApplication().get().canAs(AdminApplication.class) && resource.hasProperty(RDF.type, OWL.Ontology)) + if (getDataspace().isPresent() && getDataspace().get().canAs(AdminDataspace.class) && resource.hasProperty(RDF.type, OWL.Ontology)) { // clear cached raw graph and closure union graph if ontology is updated. TO-DO: send event instead getSystem().getRepository().remove(resource.getURI()); getSystem().getOntologyGraphs().remove(resource.getURI()); } - if (getApplication().isPresent() && resource.hasProperty(RDF.type, ACL.Authorization)) + if (getDataspace().isPresent() && resource.hasProperty(RDF.type, ACL.Authorization)) { GraphStoreClient gsc = GraphStoreClient.create(getSystem().getClient(), getSystem().getMediaTypes()). delegation(getUriInfo().getBaseUri(), getAgentContextProvider().get().orElse(null)); - getSystem().getEventBus().post(new com.atomgraph.linkeddatahub.server.event.AuthorizationCreated(getEndUserApplication(), + getSystem().getEventBus().post(new com.atomgraph.linkeddatahub.server.event.AuthorizationCreated(getEndUserDataspace(), gsc, resource)); } @@ -253,10 +253,10 @@ public Resource processRead(Resource resource) // this logic really belongs in a public Model processWrite(Model model) { // If no application (e.g., error responses), skip mbox processing - if (!getApplication().isPresent()) return super.processWrite(model); + if (!getDataspace().isPresent()) return super.processWrite(model); // show foaf:mbox in end-user apps - if (getApplication().get().canAs(EndUserApplication.class)) return super.processWrite(model); + if (getDataspace().get().canAs(EndUserDataspace.class)) return super.processWrite(model); // show foaf:mbox for authenticated agents if (getSecurityContext() != null && getSecurityContext().getUserPrincipal() instanceof Agent) return super.processWrite(model); @@ -318,12 +318,12 @@ public static Statement mboxHashStmt(Statement stmt, MessageDigest messageDigest * * @return end-user application resource */ - public EndUserApplication getEndUserApplication() + public EndUserDataspace getEndUserDataspace() { - if (getApplication().get().canAs(EndUserApplication.class)) - return getApplication().get().as(EndUserApplication.class); + if (getDataspace().get().canAs(EndUserDataspace.class)) + return getDataspace().get().as(EndUserDataspace.class); else - return getApplication().get().as(AdminApplication.class).getEndUserApplication(); + return getDataspace().get().as(AdminDataspace.class).getEndUserDataspace(); } @Override @@ -337,7 +337,7 @@ public UriInfo getUriInfo() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return application.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/AuthorizationExceptionMapper.java b/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/AuthorizationExceptionMapper.java index a709a168b5..d2f0eef45e 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/AuthorizationExceptionMapper.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/AuthorizationExceptionMapper.java @@ -17,9 +17,9 @@ package com.atomgraph.linkeddatahub.server.mapper.auth; import com.atomgraph.core.MediaTypes; -import static com.atomgraph.linkeddatahub.apps.model.AdminApplication.REQUEST_ACCESS_PATH; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import static com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace.REQUEST_ACCESS_PATH; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import org.apache.jena.rdf.model.ResourceFactory; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; @@ -47,7 +47,7 @@ public class AuthorizationExceptionMapper extends ExceptionMapperBase implements { @Context SecurityContext securityContext; - @Inject jakarta.inject.Provider> application; + @Inject jakarta.inject.Provider> application; /** * Constructs mapper from media types. @@ -68,11 +68,11 @@ public Response toResponse(AuthorizationException ex) addLiteral(HTTP.absoluteURI, ex.getAbsolutePath().toString()); // add link to the endpoint for access requests. TO-DO: make the URIs configurable or best - retrieve from sitemap/dataset - if (getSecurityContext().getUserPrincipal() != null && getApplication().isPresent()) + if (getSecurityContext().getUserPrincipal() != null && getDataspace().isPresent()) { - if (getApplication().get().canAs(EndUserApplication.class)) + if (getDataspace().get().canAs(EndUserDataspace.class)) { - Resource adminBase = getApplication().get().as(EndUserApplication.class).getAdminApplication().getBase(); + Resource adminBase = getDataspace().get().as(EndUserDataspace.class).getAdminDataspace().getBase(); URI requestAccessURI = UriBuilder.fromUri(adminBase.getURI()). path(REQUEST_ACCESS_PATH). @@ -103,7 +103,7 @@ public SecurityContext getSecurityContext() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return application.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/oauth2/TokenExpiredExceptionMapper.java b/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/oauth2/TokenExpiredExceptionMapper.java index 3a1a8c3ecb..05e11bc3b3 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/oauth2/TokenExpiredExceptionMapper.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/mapper/auth/oauth2/TokenExpiredExceptionMapper.java @@ -17,8 +17,8 @@ package com.atomgraph.linkeddatahub.server.mapper.auth.oauth2; import com.atomgraph.core.MediaTypes; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import static com.atomgraph.linkeddatahub.resource.oauth2.google.Authorize.REFERER_PARAM_NAME; import com.atomgraph.linkeddatahub.server.filter.request.auth.google.IDTokenFilter; import com.atomgraph.server.mapper.ExceptionMapperBase; @@ -45,7 +45,7 @@ public class TokenExpiredExceptionMapper extends ExceptionMapperBase implements { @Context UriInfo uriInfo; - @Inject jakarta.inject.Provider> application; + @Inject jakarta.inject.Provider> application; /** * Constructs mapper from media types. @@ -61,7 +61,7 @@ public TokenExpiredExceptionMapper(MediaTypes mediaTypes) @Override public Response toResponse(TokenExpiredException ex) { - if (!getApplication().isPresent()) + if (!getDataspace().isPresent()) { // If no application is present, just return a BAD_REQUEST response without redirect return getResponseBuilder(toResource(ex, Response.Status.BAD_REQUEST, @@ -70,7 +70,7 @@ public Response toResponse(TokenExpiredException ex) build(); } - String path = getApplication().get().getBaseURI().getPath(); + String path = getDataspace().get().getBaseURI().getPath(); NewCookie expiredCookie = new NewCookie.Builder(IDTokenFilter.COOKIE_NAME). value(""). path(path). @@ -82,7 +82,7 @@ public Response toResponse(TokenExpiredException ex) getModel()). cookie(expiredCookie); - URI redirectUri = UriBuilder.fromUri(getAdminApplication().getBaseURI()). + URI redirectUri = UriBuilder.fromUri(getAdminDataspace().getBaseURI()). path("/oauth2/authorize/google"). // TO-DO: move to config? queryParam(REFERER_PARAM_NAME, getUriInfo().getRequestUri()). // we need to retain URL query parameters build(); @@ -99,12 +99,12 @@ public Response toResponse(TokenExpiredException ex) * * @return admin application resource */ - public AdminApplication getAdminApplication() + public AdminDataspace getAdminDataspace() { - if (getApplication().get().canAs(EndUserApplication.class)) - return getApplication().get().as(EndUserApplication.class).getAdminApplication(); + if (getDataspace().get().canAs(EndUserDataspace.class)) + return getDataspace().get().as(EndUserDataspace.class).getAdminDataspace(); else - return getApplication().get().as(AdminApplication.class); + return getDataspace().get().as(AdminDataspace.class); } /** @@ -112,7 +112,7 @@ public AdminApplication getAdminApplication() * * @return optional application resource */ - public Optional getApplication() + public Optional getDataspace() { return application.get(); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java index 811c41e2bf..081e7ebc5d 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/Dispatcher.java @@ -28,7 +28,7 @@ /** * A catch-all JAX-RS resource that routes requests to sub-resources. - * Proxy requests ({@code ?uri=} and {@code lapp:Dataset}) are handled earlier by + * Proxy requests ({@code ?uri=} and {@code lds:Dataset}) are handled earlier by * {@link com.atomgraph.linkeddatahub.server.filter.request.ProxyRequestFilter} and never reach this class. * * @author Martynas Jusevičius {@literal } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/DocumentHierarchyGraphStoreImpl.java b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/DocumentHierarchyGraphStoreImpl.java index c98624436f..577dd8cf27 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/DocumentHierarchyGraphStoreImpl.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/model/impl/DocumentHierarchyGraphStoreImpl.java @@ -21,7 +21,7 @@ import com.atomgraph.core.MediaTypes; import com.atomgraph.core.model.EndpointAccessor; import com.atomgraph.core.riot.lang.RDFPostReader; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.client.GitHubClient; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import com.atomgraph.linkeddatahub.model.CSVImport; @@ -168,7 +168,7 @@ public class DocumentHierarchyGraphStoreImpl extends com.atomgraph.core.model.im */ public static final String ACCEPT_DATETIME_HEADER = "Accept-Datetime"; - private final com.atomgraph.linkeddatahub.apps.model.Application application; + private final com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application; private final OntModel ontology; private final Service service; private final Providers providers; @@ -199,7 +199,7 @@ public class DocumentHierarchyGraphStoreImpl extends com.atomgraph.core.model.im */ @Inject public DocumentHierarchyGraphStoreImpl(@Context Request request, @Context UriInfo uriInfo, MediaTypes mediaTypes, - com.atomgraph.linkeddatahub.apps.model.Application application, Optional ontology, Optional service, + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace application, Optional ontology, Optional service, @Context SecurityContext securityContext, Optional agentContext, @Context Providers providers, com.atomgraph.linkeddatahub.Application system, @Context HttpHeaders httpHeaders) { @@ -293,7 +293,7 @@ public Response get() } GitHubClient.CommitInfo commit = getSystem().getGraphVersioningService(). - getMemento(getApplication().getURI(), getApplication().getBaseURI(), getURI(), datetime). + getMemento(getDataspace().getURI(), getDataspace().getBaseURI(), getURI(), datetime). orElseThrow(() -> new NotFoundException("Document <" + getURI() + "> has no version history")); // negotiation has to see the current history, and Accept-Datetime takes unbounded values, so the @@ -312,7 +312,7 @@ public Response get() if (getUriInfo().getQueryParameters().containsKey(TIMEMAP_PARAM_NAME)) { Model timeMap = getSystem().getGraphVersioningService(). - getTimeMap(getApplication().getURI(), getApplication().getBaseURI(), getURI()). + getTimeMap(getDataspace().getURI(), getDataspace().getBaseURI(), getURI()). orElseThrow(() -> new NotFoundException("Document <" + getURI() + "> has no version history")); // link-format is only offered on the TimeMap, where it is meaningful; it leads the list so that @@ -339,7 +339,7 @@ public Response get() if (!version.matches("[0-9a-f]{4,64}")) throw new NotFoundException("Version '" + version + "' of graph <" + getURI() + "> not found"); com.atomgraph.linkeddatahub.server.util.GraphVersioningService.Version graphVersion = getSystem().getGraphVersioningService(). - getVersion(getApplication().getURI(), getApplication().getBaseURI(), getURI(), version). + getVersion(getDataspace().getURI(), getDataspace().getBaseURI(), getURI(), version). orElseThrow(() -> new NotFoundException("Version '" + version + "' of graph <" + getURI() + "> not found")); CacheControl cacheControl = new CacheControl(); @@ -455,7 +455,7 @@ public Response put(Model model) removeAll(SIOC.HAS_PARENT). removeAll(SIOC.HAS_CONTAINER); - if (!getApplication().getBaseURI().equals(getURI())) // don't update Root document's metadata + if (!getDataspace().getBaseURI().equals(getURI())) // don't update Root document's metadata { if (resource.hasProperty(RDF.type, DH.Container)) resource.addProperty(SIOC.HAS_PARENT, parent); @@ -956,7 +956,7 @@ public void submitImports(Model model) filterKeep(_import -> { return _import.canAs(CSVImport.class) || _import.canAs(RDFImport.class); }); // canAs(Import.class) would require InfModel try { - Service adminService = getApplication().canAs(EndUserApplication.class) ? getApplication().as(EndUserApplication.class).getAdminApplication().getService() : null; + Service adminService = getDataspace().canAs(EndUserDataspace.class) ? getDataspace().as(EndUserDataspace.class).getAdminDataspace().getService() : null; GraphStoreClient gsc = GraphStoreClient.create(getSystem().getImportClient(), getSystem().getMediaTypes()). delegation(getUriInfo().getBaseUri(), getAgentContext().orElse(null)); @@ -966,9 +966,9 @@ public void submitImports(Model model) // start the import asynchroniously if (_import.canAs(CSVImport.class)) - getSystem().submitImport(_import.as(CSVImport.class), getApplication(), getApplication().getService(), adminService, getUriInfo().getBaseUri().toString(), gsc); + getSystem().submitImport(_import.as(CSVImport.class), getDataspace(), getDataspace().getService(), adminService, getUriInfo().getBaseUri().toString(), gsc); if (_import.canAs(RDFImport.class)) - getSystem().submitImport(_import.as(RDFImport.class), getApplication(), getApplication().getService(), adminService, getUriInfo().getBaseUri().toString(), gsc); + getSystem().submitImport(_import.as(RDFImport.class), getDataspace(), getDataspace().getService(), adminService, getUriInfo().getBaseUri().toString(), gsc); } } finally @@ -1300,7 +1300,7 @@ public MessageDigest getMessageDigest() * * @return application resource */ - public com.atomgraph.linkeddatahub.apps.model.Application getApplication() + public com.atomgraph.linkeddatahub.dataspaces.model.Dataspace getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/util/AuthorizationParams.java b/src/main/java/com/atomgraph/linkeddatahub/server/util/AuthorizationParams.java index c57e9c9c14..761d28cc8b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/util/AuthorizationParams.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/util/AuthorizationParams.java @@ -17,7 +17,7 @@ package com.atomgraph.linkeddatahub.server.util; import com.atomgraph.linkeddatahub.vocabulary.ACL; -import com.atomgraph.server.vocabulary.LDT; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.spinrdf.vocabulary.SPIN; import java.util.function.Supplier; import org.apache.jena.query.QuerySolutionMap; @@ -59,7 +59,7 @@ public QuerySolutionMap get() { QuerySolutionMap qsm = new QuerySolutionMap(); qsm.add(SPIN.THIS_VAR_NAME, getAbsolutePath()); - qsm.add(LDT.base.getLocalName(), getBase()); + qsm.add(LDS.base.getLocalName(), getBase()); if (getAgent() != null) { diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/util/GraphVersioningService.java b/src/main/java/com/atomgraph/linkeddatahub/server/util/GraphVersioningService.java index 2253d81cee..822fe2f417 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/util/GraphVersioningService.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/util/GraphVersioningService.java @@ -20,7 +20,7 @@ import com.atomgraph.linkeddatahub.client.GitHubClient; import com.atomgraph.linkeddatahub.model.ServiceContext; import com.atomgraph.linkeddatahub.vocabulary.GitHub; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.vocabulary.PROV; import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.client.Client; @@ -83,7 +83,7 @@ public record Repository(GitHubClient client, String pathPrefix) { } /** * Builds the per-application repository map from the context model. - * Applications without a lapp:versioningRepository are not versioned. + * Applications without a lds:versioningRepository are not versioned. * * @param contextModel union model of the context dataset * @param client HTTP client with standard TLS server verification @@ -92,7 +92,7 @@ public GraphVersioningService(Model contextModel, Client client) { repositories = new HashMap<>(); - StmtIterator it = contextModel.listStatements(null, LAPP.versioningRepository, (org.apache.jena.rdf.model.RDFNode)null); + StmtIterator it = contextModel.listStatements(null, LDS.versioningRepository, (org.apache.jena.rdf.model.RDFNode)null); try { while (it.hasNext()) diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/util/OntologyRepository.java b/src/main/java/com/atomgraph/linkeddatahub/server/util/OntologyRepository.java index 90ad92afbd..f5da5ecc9e 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/util/OntologyRepository.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/util/OntologyRepository.java @@ -16,10 +16,10 @@ */ package com.atomgraph.linkeddatahub.server.util; -import com.atomgraph.server.vocabulary.LDT; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.core.client.GraphStoreClient; import com.atomgraph.client.util.jena.PrefixGraphRepository; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import jakarta.ws.rs.core.MultivaluedHashMap; import jakarta.ws.rs.core.MultivaluedMap; import jakarta.ws.rs.core.Response; @@ -54,7 +54,7 @@ public class OntologyRepository extends PrefixGraphRepository */ public static final String ONTOLOGY_XKEY = "urn:linkeddatahub:ontology"; - private final EndUserApplication app; + private final EndUserDataspace app; private final com.atomgraph.linkeddatahub.Application system; private final Query ontologyQuery; @@ -66,7 +66,7 @@ public class OntologyRepository extends PrefixGraphRepository * @param gsc Graph Store client for HTTP fallback loading * @param ontologyQuery SPARQL query that loads ontology terms */ - public OntologyRepository(EndUserApplication app, com.atomgraph.linkeddatahub.Application system, GraphStoreClient gsc, Query ontologyQuery) + public OntologyRepository(EndUserDataspace app, com.atomgraph.linkeddatahub.Application system, GraphStoreClient gsc, Query ontologyQuery) { super(gsc); this.app = app; @@ -107,7 +107,7 @@ public Graph get(String uri) // attempt to load the ontology from the admin endpoint ParameterizedSparqlString ontologyPss = new ParameterizedSparqlString(getOntologyQuery().toString()); - ontologyPss.setIri(LDT.ontology.getLocalName(), uri); + ontologyPss.setIri(LDS.ontology.getLocalName(), uri); // Surrogate-key hints for the CONSTRUCT this is about to cache in varnish-admin. The VCL promotes the // header verbatim into the response's xkey index, which reads it as a space-separated key list, so this @@ -121,7 +121,7 @@ public Graph get(String uri) headers.putSingle("X-Xkey-Promote", uri + " " + ONTOLOGY_XKEY); Model model; - try (Response cr = getSystem().getServiceContext(getApplication().getAdminApplication().getService()).getSPARQLClient(). + try (Response cr = getSystem().getServiceContext(getDataspace().getAdminDataspace().getService()).getSPARQLClient(). query(ontologyPss.asQuery(), Model.class, new MultivaluedHashMap<>(), headers)) { model = cr.readEntity(Model.class); @@ -143,7 +143,7 @@ public Graph get(String uri) * * @return application resource */ - public EndUserApplication getApplication() + public EndUserDataspace getDataspace() { return app; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/server/util/PackageService.java b/src/main/java/com/atomgraph/linkeddatahub/server/util/PackageService.java index 25ff7e4631..eac99bb1ff 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/server/util/PackageService.java +++ b/src/main/java/com/atomgraph/linkeddatahub/server/util/PackageService.java @@ -18,8 +18,8 @@ import com.atomgraph.client.util.jena.PrefixGraphRepository; import com.atomgraph.core.client.GraphStoreClient; -import com.atomgraph.linkeddatahub.apps.model.AdminApplication; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.AdminDataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.vocabulary.DH; import com.atomgraph.linkeddatahub.vocabulary.FOAF; import com.atomgraph.linkeddatahub.vocabulary.SIOC; @@ -92,7 +92,7 @@ public PackageService(com.atomgraph.linkeddatahub.Application system) * @param app application resource * @return list of package URIs */ - public List getPackageURIs(com.atomgraph.linkeddatahub.apps.model.Application app) + public List getPackageURIs(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app) { return app.getImportedPackages().stream(). filter(Resource::isURIResource). @@ -109,7 +109,7 @@ public List getPackageURIs(com.atomgraph.linkeddatahub.apps.model.Applicati * @param app application resource * @return list of package resources */ - public List getPackages(com.atomgraph.linkeddatahub.apps.model.Application app) + public List getPackages(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app) { return app.getImportedPackages().stream(). filter(Resource::isURIResource). @@ -127,7 +127,7 @@ public List getPackages(com.atom * @param app application resource * @return list of stylesheet URLs */ - public List getStylesheets(com.atomgraph.linkeddatahub.apps.model.Application app) + public List getStylesheets(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app) { return getStylesheets(getPackages(app), app); } @@ -146,7 +146,7 @@ public List getStylesheets(com.atomgraph.linkeddatahub.apps.model.Applicati * @param app application resource whose origin serves the copies * @return list of stylesheet URLs */ - public List getStylesheets(List packages, com.atomgraph.linkeddatahub.apps.model.Application app) + public List getStylesheets(List packages, com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app) { return packages.stream(). filter(pkg -> pkg.getStylesheet() != null && pkg.getStylesheet().isURIResource()). @@ -163,7 +163,7 @@ public List getStylesheets(List getOntologies(com.atomgraph.linkeddatahub.apps.model.Application app) + public List getOntologies(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app) { return getOntologies(getPackages(app)); } @@ -239,10 +239,10 @@ public List getOntologies(com.atomgraph.linkeddatahub.apps.model.Applicatio * @param packages package resources * @return list of package ontology URIs */ - public List getOntologies(List packages) + public List getOntologies(List packages) { return packages.stream(). - map(com.atomgraph.linkeddatahub.apps.model.Package::getOntology). + map(com.atomgraph.linkeddatahub.dataspaces.model.Package::getOntology). filter(Objects::nonNull). filter(Resource::isURIResource). map(ontology -> URI.create(ontology.getURI())). @@ -269,7 +269,7 @@ public List getOntologies(List packages, EndUserApplication endUserApp) + public void materialize(List packages, EndUserDataspace endUserApp) { - for (com.atomgraph.linkeddatahub.apps.model.Package pkg : packages) + for (com.atomgraph.linkeddatahub.dataspaces.model.Package pkg : packages) { if (pkg.getOntology() == null || !pkg.getOntology().isURIResource()) continue; @@ -307,7 +307,7 @@ public void materialize(List pac Resource doc = model.createResource(docURI.toString()). addProperty(RDF.type, DH.Item). - addProperty(SIOC.HAS_CONTAINER, model.createResource(endUserApp.getAdminApplication().getBaseURI().resolve(ONTOLOGIES_PATH).toString())). + addProperty(SIOC.HAS_CONTAINER, model.createResource(endUserApp.getAdminDataspace().getBaseURI().resolve(ONTOLOGIES_PATH).toString())). addProperty(FOAF.primaryTopic, model.getResource(ontologyURI)); if (pkg.hasProperty(DCTerms.title)) doc.addProperty(DCTerms.title, pkg.getProperty(DCTerms.title).getObject()); @@ -320,7 +320,7 @@ public void materialize(List pac // reads, so a stored blank node means a different tag on every read. new Skolemizer(docURI.toString()).apply(model); - getSystem().getServiceContext(endUserApp.getAdminApplication().getService()).getGraphStoreClient().putModel(docURI.toString(), model); + getSystem().getServiceContext(endUserApp.getAdminDataspace().getService()).getGraphStoreClient().putModel(docURI.toString(), model); if (log.isInfoEnabled()) log.info("Materialized package ontology <{}> as <{}>", ontologyURI, docURI); } @@ -343,9 +343,9 @@ public void materialize(List pac * @param pkg package resource * @return document URI, or null if the admin application is unknown */ - public URI getDocumentURI(EndUserApplication endUserApp, com.atomgraph.linkeddatahub.apps.model.Package pkg) + public URI getDocumentURI(EndUserDataspace endUserApp, com.atomgraph.linkeddatahub.dataspaces.model.Package pkg) { - AdminApplication adminApp = endUserApp.getAdminApplication(); + AdminDataspace adminApp = endUserApp.getAdminDataspace(); if (adminApp == null) return null; return adminApp.getUriBuilder().path(ONTOLOGIES_PATH).path("{slug}/").build(getSlug(URI.create(pkg.getURI()))); @@ -376,7 +376,7 @@ public String getSlug(URI packageURI) * @param packageURI package URI * @return package resource, or null if the description could not be resolved */ - public com.atomgraph.linkeddatahub.apps.model.Package getPackage(String packageURI) + public com.atomgraph.linkeddatahub.dataspaces.model.Package getPackage(String packageURI) { final PrefixGraphRepository repository = getSystem().getRepository(); final Model model; @@ -395,9 +395,9 @@ public com.atomgraph.linkeddatahub.apps.model.Package getPackage(String packageU // guards against for uploaded ontologies URI docURI = UriBuilder.fromUri(packageURI).fragment(null).build(); // skip fragment from the package URI to get its graph URI Resource appResource = getSystem().matchApp(docURI); - if (appResource != null && appResource.canAs(com.atomgraph.linkeddatahub.apps.model.Application.class)) + if (appResource != null && appResource.canAs(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class)) { - com.atomgraph.linkeddatahub.apps.model.Application app = appResource.as(com.atomgraph.linkeddatahub.apps.model.Application.class); + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app = appResource.as(com.atomgraph.linkeddatahub.dataspaces.model.Dataspace.class); model = getSystem().getServiceContext(app.getService()).getGraphStoreClient().getModel(docURI.toString()); } else @@ -417,7 +417,7 @@ public com.atomgraph.linkeddatahub.apps.model.Package getPackage(String packageU try { - return model.getResource(packageURI).as(com.atomgraph.linkeddatahub.apps.model.Package.class); + return model.getResource(packageURI).as(com.atomgraph.linkeddatahub.dataspaces.model.Package.class); } catch (UnsupportedPolymorphismException ex) { @@ -433,11 +433,11 @@ public com.atomgraph.linkeddatahub.apps.model.Package getPackage(String packageU * @param graphURI graph URI * @return true if the graph exists */ - protected boolean containsGraph(EndUserApplication endUserApp, URI graphURI) + protected boolean containsGraph(EndUserDataspace endUserApp, URI graphURI) { try { - return getSystem().getServiceContext(endUserApp.getAdminApplication().getService()).getGraphStoreClient().containsModel(graphURI.toString()); + return getSystem().getServiceContext(endUserApp.getAdminDataspace().getService()).getGraphStoreClient().containsModel(graphURI.toString()); } catch (RuntimeException ex) { diff --git a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/DH.java b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/DH.java index 140b2e511e..faa289c254 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/DH.java +++ b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/DH.java @@ -39,7 +39,7 @@ public class DH private static OntModel m_model = OntModelFactory.createModel(OntSpecification.OWL2_FULL_MEM); /**

    The namespace of the vocabulary as a string

    */ - public static final String NS = "https://www.w3.org/ns/ldt/document-hierarchy#"; + public static final String NS = "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#"; /**

    The namespace of the vocabulary as a string

    * @return namespace URI diff --git a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LACL.java b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LACL.java index bf4123de90..8405b1f9de 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LACL.java +++ b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LACL.java @@ -73,9 +73,6 @@ public static String getURI() /** Request agent property **/ public static final Property requestAgent = m_model.createObjectProperty( NS + "requestAgent" ); - /** Request agent group property **/ - public static final Property requestAgentGroup = m_model.createObjectProperty( NS + "requestAgentGroup" ); - /** Request access to property */ public static final Property requestAccessTo = m_model.createObjectProperty( NS + "requestAccessTo" ); diff --git a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LAPP.java b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LDS.java similarity index 67% rename from src/main/java/com/atomgraph/linkeddatahub/vocabulary/LAPP.java rename to src/main/java/com/atomgraph/linkeddatahub/vocabulary/LDS.java index 5080390966..f130511a5a 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LAPP.java +++ b/src/main/java/com/atomgraph/linkeddatahub/vocabulary/LDS.java @@ -24,11 +24,11 @@ import org.apache.jena.rdf.model.Resource; /** - * LAPP vocabulary. + * LDS vocabulary. * * @author Martynas Jusevičius {@literal } */ -public class LAPP +public class LDS { static @@ -40,7 +40,7 @@ public class LAPP private static OntModel m_model = OntModelFactory.createModel(OntSpecification.OWL2_FULL_MEM); /** The namespace of the vocabulary as a string */ - public static final String NS = "https://w3id.org/atomgraph/linkeddatahub/apps#"; + public static final String NS = "https://w3id.org/atomgraph/linkeddatahub/dataspaces#"; /** * The namespace of the vocabulary as a string @@ -56,33 +56,24 @@ public static String getURI() /** The namespace of the vocabulary as a resource */ public static final Resource NAMESPACE = m_model.createResource( NS ); - /** Application class */ + /** System context class */ public static final Resource Context = m_model.createOntClass( NS + "Context" ); /** Dataset class */ public static final Resource Dataset = m_model.createOntClass( NS + "Dataset" ); - /** Application class */ - public static final Resource Application = m_model.createOntClass( NS + "Application" ); + /** Dataspace class */ + public static final Resource Dataspace = m_model.createOntClass( NS + "Dataspace" ); - /** Admin application class */ - public static final Resource AdminApplication = m_model.createOntClass( NS + "AdminApplication" ); + /** Admin dataspace class */ + public static final Resource AdminDataspace = m_model.createOntClass( NS + "AdminDataspace" ); - /** End-user application class */ - public static final Resource EndUserApplication = m_model.createOntClass( NS + "EndUserApplication" ); + /** End-user dataspace class */ + public static final Resource EndUserDataspace = m_model.createOntClass( NS + "EndUserDataspace" ); /** Package class */ public static final Resource Package = m_model.createOntClass( NS + "Package" ); - /** Admin application class */ -// public static final Property adminApplication = m_model.createObjectProperty( NS + "adminApplication" ); -// -// /** End-user application class */ -// public static final Property endUserApplication = m_model.createObjectProperty( NS + "endUserApplication" ); - - /** Frontend proxy property */ - public static final Property frontendProxy = m_model.createObjectProperty( NS + "frontendProxy" ); - /** Backend proxy property */ public static final Property backendProxy = m_model.createObjectProperty( NS + "backendProxy" ); @@ -92,13 +83,22 @@ public static String getURI() /** Read-only property */ public static final Property allowRead = m_model.createDataProperty( NS + "allowRead" ); - /** Origin property for subdomain-based application matching */ + /** Origin property for subdomain-based dataspace matching */ public static final Property origin = m_model.createObjectProperty(NS + "origin"); - /** Application property (for Link header rel) */ - public static final Property application = m_model.createObjectProperty( NS + "application" ); + /** Base URI property */ + public static final Property base = m_model.createObjectProperty( NS + "base" ); + + /** Ontology property */ + public static final Property ontology = m_model.createObjectProperty( NS + "ontology" ); + + /** SPARQL service property */ + public static final Property service = m_model.createObjectProperty( NS + "service" ); + + /** Dataspace property (for Link header rel) */ + public static final Property dataspace = m_model.createObjectProperty( NS + "dataspace" ); - /** Versioning repository property linking an application to a doap:GitRepository */ + /** Versioning repository property linking a dataspace to a doap:GitRepository */ public static final Property versioningRepository = m_model.createObjectProperty( NS + "versioningRepository" ); } diff --git a/src/main/java/com/atomgraph/linkeddatahub/writer/ModelXSLTWriter.java b/src/main/java/com/atomgraph/linkeddatahub/writer/ModelXSLTWriter.java index 69977133f2..88cb75efc1 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/writer/ModelXSLTWriter.java +++ b/src/main/java/com/atomgraph/linkeddatahub/writer/ModelXSLTWriter.java @@ -16,7 +16,7 @@ package com.atomgraph.linkeddatahub.writer; import com.atomgraph.client.util.RDFSourceResolver; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.model.auth.Agent; import com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider; import java.lang.annotation.Annotation; @@ -129,7 +129,7 @@ public void writeTo(Model model, Class type, Type genericType, Annotation[] a public Model processWrite(Model model) { // show foaf:mbox in end-user apps - if (getApplication().get().isPresent() && getApplication().get().get().canAs(EndUserApplication.class)) return model; + if (getDataspace().get().isPresent() && getDataspace().get().get().canAs(EndUserDataspace.class)) return model; // show foaf:mbox for authenticated agents if (getSecurityContext() != null && getSecurityContext().getUserPrincipal() instanceof Agent) return model; diff --git a/src/main/java/com/atomgraph/linkeddatahub/writer/XSLTWriterBase.java b/src/main/java/com/atomgraph/linkeddatahub/writer/XSLTWriterBase.java index 47248df4a4..7d3b8d8c52 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/writer/XSLTWriterBase.java +++ b/src/main/java/com/atomgraph/linkeddatahub/writer/XSLTWriterBase.java @@ -24,7 +24,7 @@ import com.atomgraph.linkeddatahub.vocabulary.LDHT; import com.atomgraph.linkeddatahub.vocabulary.Google; import com.atomgraph.linkeddatahub.vocabulary.ORCID; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.core.util.Link; import com.atomgraph.linkeddatahub.server.security.AuthorizationContext; import com.atomgraph.linkeddatahub.vocabulary.FOAF; @@ -86,7 +86,7 @@ public abstract class XSLTWriterBase extends com.atomgraph.client.writer.XSLTWri @Context SecurityContext securityContext; @Inject com.atomgraph.linkeddatahub.Application system; - @Inject jakarta.inject.Provider> application; + @Inject jakarta.inject.Provider> application; @Inject jakarta.inject.Provider resolver; @Inject jakarta.inject.Provider xsltExecSupplier; @Inject jakarta.inject.Provider crc; @@ -118,15 +118,15 @@ public Map getParameters(MultivaluedMap appOpt = getApplication().get(); + Optional appOpt = getDataspace().get(); if (appOpt.isPresent()) { - com.atomgraph.linkeddatahub.apps.model.Application app = appOpt.get(); - if (log.isDebugEnabled()) log.debug("Passing $lapp:Application to XSLT: <{}>", app); - params.put(new QName("lapp", LAPP.origin.getNameSpace(), LAPP.origin.getLocalName()), new XdmAtomicValue(app.getOriginURI())); + com.atomgraph.linkeddatahub.dataspaces.model.Dataspace app = appOpt.get(); + if (log.isDebugEnabled()) log.debug("Passing $lds:Dataspace to XSLT: <{}>", app); + params.put(new QName("lds", LDS.origin.getNameSpace(), LDS.origin.getLocalName()), new XdmAtomicValue(app.getOriginURI())); } if (getSecurityContext() != null && getSecurityContext().getUserPrincipal() instanceof Agent) @@ -301,7 +301,7 @@ public Set getSupportedNamespaces() * * @return provider */ - public jakarta.inject.Provider> getApplication() + public jakarta.inject.Provider> getDataspace() { return application; } diff --git a/src/main/java/com/atomgraph/linkeddatahub/writer/factory/SourceResolverFactory.java b/src/main/java/com/atomgraph/linkeddatahub/writer/factory/SourceResolverFactory.java index daca9faeb5..0fab235154 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/writer/factory/SourceResolverFactory.java +++ b/src/main/java/com/atomgraph/linkeddatahub/writer/factory/SourceResolverFactory.java @@ -20,11 +20,11 @@ import jakarta.ws.rs.ext.Provider; import com.atomgraph.client.util.RDFSourceResolver; import com.atomgraph.client.util.jena.PrefixGraphRepository; -import com.atomgraph.linkeddatahub.apps.model.Application; -import com.atomgraph.linkeddatahub.apps.model.EndUserApplication; +import com.atomgraph.linkeddatahub.dataspaces.model.Dataspace; +import com.atomgraph.linkeddatahub.dataspaces.model.EndUserDataspace; import com.atomgraph.linkeddatahub.client.GraphStoreClient; import com.atomgraph.linkeddatahub.server.security.AgentContext; -import com.atomgraph.linkeddatahub.vocabulary.LAPP; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.linkeddatahub.writer.impl.SameSiteSourceResolver; import java.util.Optional; import jakarta.inject.Inject; @@ -59,7 +59,7 @@ public class SourceResolverFactory implements Factory public RDFSourceResolver provide() { // falls back to the global repository if there is no application (e.g. for error responses) - return getResolver(getApplication()); + return getResolver(getDataspace()); } @Override @@ -74,12 +74,12 @@ public void dispose(RDFSourceResolver t) * @param appOpt optional end-user application (if empty, the global repository is used) * @return source resolver */ - public RDFSourceResolver getResolver(Optional appOpt) + public RDFSourceResolver getResolver(Optional appOpt) { final PrefixGraphRepository repository; - if (appOpt.isPresent() && appOpt.get().canAs(EndUserApplication.class)) - repository = getSystem().getRepository(appOpt.get().as(EndUserApplication.class)); + if (appOpt.isPresent() && appOpt.get().canAs(EndUserDataspace.class)) + repository = getSystem().getRepository(appOpt.get().as(EndUserDataspace.class)); else repository = getSystem().getRepository(); @@ -151,13 +151,13 @@ public ContainerRequestContext getContainerRequestContext() } /** - * Retrieves LDT application from the request context. + * Retrieves the dataspace from the request context. * - * @return optional LDT application + * @return optional dataspace */ - public Optional getApplication() + public Optional getDataspace() { - return (Optional)getContainerRequestContext().getProperty(LAPP.Application.getURI()); + return (Optional)getContainerRequestContext().getProperty(LDS.Dataspace.getURI()); } } \ No newline at end of file diff --git a/src/main/java/com/atomgraph/server/mapper/ExceptionMapperBase.java b/src/main/java/com/atomgraph/server/mapper/ExceptionMapperBase.java index 8295268542..220be7f397 100644 --- a/src/main/java/com/atomgraph/server/mapper/ExceptionMapperBase.java +++ b/src/main/java/com/atomgraph/server/mapper/ExceptionMapperBase.java @@ -32,7 +32,7 @@ import jakarta.ws.rs.ext.Provider; import com.atomgraph.core.MediaTypes; import com.atomgraph.core.util.Link; -import com.atomgraph.server.vocabulary.LDT; +import com.atomgraph.linkeddatahub.vocabulary.LDS; import com.atomgraph.server.vocabulary.HTTP; import jakarta.inject.Inject; import jakarta.ws.rs.core.HttpHeaders; @@ -88,12 +88,12 @@ public Response.ResponseBuilder getResponseBuilder(Model model) // new EntityTag(Long.toHexString(ModelUtils.hashModel(model))), // variant). // getResponseBuilder(). -// header(HttpHeaders.LINK, new Link(getUriInfo().getBaseUri(), LDT.base.getURI(), null)); +// header(HttpHeaders.LINK, new Link(getUriInfo().getBaseUri(), LDS.base.getURI(), null)); return Response.ok(). // status will be overriden in the subclasses entity(model). variant(variant). - header(HttpHeaders.LINK, new Link(getUriInfo().getBaseUri(), LDT.base.getURI(), null)); + header(HttpHeaders.LINK, new Link(getUriInfo().getBaseUri(), LDS.base.getURI(), null)); } /** diff --git a/src/main/java/com/atomgraph/server/vocabulary/LDT.java b/src/main/java/com/atomgraph/server/vocabulary/LDT.java deleted file mode 100644 index e9bb82e871..0000000000 --- a/src/main/java/com/atomgraph/server/vocabulary/LDT.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright 2014 Martynas Jusevičius - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.atomgraph.server.vocabulary; - -import org.apache.jena.ontapi.OntModelFactory; -import org.apache.jena.ontapi.OntSpecification; -import org.apache.jena.ontapi.model.OntModel; -import org.apache.jena.rdf.model.Property; - -import org.apache.jena.rdf.model.Resource; - -/** - * Linked Data Templates vocabulary. - * - * @author Martynas Jusevičius {@literal } - */ -public final class LDT -{ - - static - { - org.apache.jena.sys.JenaSystem.init(); // ensure Jena (RDFS vocab) is initialized before ontapi touches it - } - /**

    The RDF model that holds the vocabulary terms

    */ - private static OntModel m_model = OntModelFactory.createModel(OntSpecification.OWL2_FULL_MEM); - - /**

    The namespace of the vocabulary as a string

    */ - public static final String NS = "https://www.w3.org/ns/ldt#"; - - /**

    The namespace of the vocabulary as a string

    - * @see #NS */ - public static String getURI() - { - return NS; - } - - /**

    The namespace of the vocabulary as a resource

    */ - public static final Resource NAMESPACE = m_model.createResource( NS ); - - public static final Resource Application = m_model.createOntClass( NS + "Application" ); - - public static final Resource Ontology = m_model.createOntClass( NS + "Ontology" ); - - public static final Resource Template = m_model.createOntClass( NS + "Template" ); - - public static final Resource Parameter = m_model.createOntClass( NS + "Parameter" ); - - public static final Resource TemplateCall = m_model.createOntClass( NS + "TemplateCall" ); - - public static final Resource Argument = m_model.createOntClass( NS + "Argument" ); - - public static final Property base = m_model.createObjectProperty( NS + "base" ); - - public static final Property ontology = m_model.createObjectProperty( NS + "ontology" ); - - public static final Property service = m_model.createObjectProperty( NS + "service" ); - - public static final Property arg = m_model.createObjectProperty( NS + "arg" ); - - public static final Property paramName = m_model.createDataProperty( NS + "paramName" ); - - // "extends" is a reserved keyword in Java, obviously - public static final Property extends_ = m_model.createObjectProperty( NS + "extends" ); - - public static final Property path = m_model.createDataProperty( NS + "path" ); - - public static final Property query = m_model.createObjectProperty( NS + "query" ); - - public static final Property update = m_model.createObjectProperty( NS + "update" ); - - public static final Property match = m_model.createDataProperty( NS + "match" ); - - public static final Property priority = m_model.createDataProperty( NS + "priority" ); - - public static final Property fragment = m_model.createDataProperty( NS + "fragment" ); - - public static final Property param = m_model.createObjectProperty( NS + "param" ); - - public static final Property loadClass = m_model.createObjectProperty( NS + "loadClass" ); - - public static final Property cacheControl = m_model.createDataProperty( NS + "cacheControl" ); - - public static final Property template = m_model.createObjectProperty( NS + "template" ); - -} diff --git a/src/main/resources/com/atomgraph/linkeddatahub/app/admin/adm.ttl b/src/main/resources/com/atomgraph/linkeddatahub/app/admin/adm.ttl index 411ebc987d..6f33292d03 100644 --- a/src/main/resources/com/atomgraph/linkeddatahub/app/admin/adm.ttl +++ b/src/main/resources/com/atomgraph/linkeddatahub/app/admin/adm.ttl @@ -8,8 +8,7 @@ @prefix owl: . @prefix acl: . @prefix cert: . -@prefix ldt: . -@prefix dh: . +@prefix dh: . @prefix sh: . @prefix sp: . @prefix spin: . diff --git a/src/main/resources/com/atomgraph/linkeddatahub/app/admin/lacl.ttl b/src/main/resources/com/atomgraph/linkeddatahub/app/admin/lacl.ttl index b547724968..ae28703c3f 100644 --- a/src/main/resources/com/atomgraph/linkeddatahub/app/admin/lacl.ttl +++ b/src/main/resources/com/atomgraph/linkeddatahub/app/admin/lacl.ttl @@ -8,8 +8,7 @@ @prefix owl: . @prefix acl: . @prefix cert: . -@prefix c: . -@prefix dh: . +@prefix dh: . @prefix dct: . @prefix sp: . @prefix spin: . @@ -18,7 +17,7 @@ : a owl:Ontology ; owl:imports ldh:, , , , cert: ; - owl:versionInfo "1.1.4" ; + owl:versionInfo "1.2.0" ; rdfs:label "LinkedDataHub ACL ontology" . :password a owl:DatatypeProperty ; @@ -61,7 +60,7 @@ rdfs:isDefinedBy : . :requestAccess a owl:ObjectProperty ; - rdfs:range c:Document ; + rdfs:range foaf:Document ; rdfs:label "Request access" ; rdfs:isDefinedBy : . @@ -108,8 +107,8 @@ WHERE {}""" ; rdfs:isDefinedBy : . -:CreatorAuthorization a rdfs:Class, owl:Class ; +:OwnerAuthorization a rdfs:Class, owl:Class ; rdfs:subClassOf acl:Authorization ; - rdfs:label "Creator access" ; - rdfs:comment "Creators have full control of their created resources" ; + rdfs:label "Owner access" ; + rdfs:comment "Granted in-memory to the owner of a document, carrying acl:Read, acl:Append and acl:Write. Never stored: AuthorizationFilter mints it per request once the agent is found to be the owner, before the ACL query runs" ; rdfs:isDefinedBy : . \ No newline at end of file diff --git a/src/main/resources/com/atomgraph/linkeddatahub/def.ttl b/src/main/resources/com/atomgraph/linkeddatahub/def.ttl index 0dd0e2592e..e6f9520d3e 100644 --- a/src/main/resources/com/atomgraph/linkeddatahub/def.ttl +++ b/src/main/resources/com/atomgraph/linkeddatahub/def.ttl @@ -1,13 +1,13 @@ @base . @prefix : <#> . -@prefix lapp: . +@prefix lds: . @prefix ldh: . @prefix rdf: . @prefix rdfs: . @prefix owl: . @prefix sd: . -@prefix dh: . +@prefix dh: . @prefix sp: . @prefix spin: . @prefix sioc: . @@ -18,7 +18,7 @@ : a owl:Ontology ; rdfs:label "Default" ; rdfs:comment "Default document model" ; - owl:imports ldh:, lapp:, sd:, sp: ; + owl:imports ldh:, lds:, sd:, sp: ; owl:versionInfo "1.0-SNAPSHOT" . :Root a owl:Class ; @@ -63,7 +63,7 @@ nfo:FileDataObject rdfs:label "File" ; sd:Service spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ; spin:constraint :MissingTitle . -# https://w3id.org/atomgraph/linkeddatahub/apps +# https://w3id.org/atomgraph/linkeddatahub/dataspaces -lapp:Application spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ; +lds:Dataspace spin:constructor ldh:TitleConstructor, ldh:DescriptionConstructor ; spin:constraint :MissingTitle . \ No newline at end of file diff --git a/src/main/resources/com/atomgraph/linkeddatahub/dh.ttl b/src/main/resources/com/atomgraph/linkeddatahub/dh.ttl index a3dae50f24..f3e29cec46 100644 --- a/src/main/resources/com/atomgraph/linkeddatahub/dh.ttl +++ b/src/main/resources/com/atomgraph/linkeddatahub/dh.ttl @@ -1,11 +1,10 @@ -@base . +@base . @prefix : <#> . @prefix rdf: . @prefix rdfs: . @prefix xsd: . @prefix owl: . -@prefix ldt: . @prefix sp: . @prefix spin: . @prefix dct: . @@ -15,11 +14,11 @@ : a owl:Ontology ; owl:imports foaf:, sioc:, sp: ; - owl:versionInfo "1.1.5" ; + owl:versionInfo "2.0.0" ; rdfs:label "Document hierarchy" ; dct:created "2016-08-31T21:54:00+02:00"^^xsd:dateTime ; - dct:modified "2019-12-13T12:06:00+01:00"^^xsd:dateTime ; - vann:preferredNamespaceUri "https://www.w3.org/ns/ldt/document-hierarchy#" ; + dct:modified "2026-09-25T00:00:00+02:00"^^xsd:dateTime ; + vann:preferredNamespaceUri "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#" ; vann:preferredNamespacePrefix "dh"; dct:license . @@ -36,7 +35,6 @@ :Document a rdfs:Class, owl:Class ; rdfs:subClassOf foaf:Document ; - # ldt:path "{slug}/" ; rdfs:label "Document" ; # spin:constructor :DocumentConstructor ; rdfs:isDefinedBy : . @@ -60,7 +58,7 @@ :DocumentConstructor a sp:Construct, sp:Query ; sp:text """ PREFIX xsd: - PREFIX dh: + PREFIX dh: CONSTRUCT { ?this dh:slug ?slug . @@ -73,7 +71,7 @@ :ContainerConstructor a sp:Construct, sp:Query ; sp:text """ - PREFIX dh: + PREFIX dh: PREFIX sioc: CONSTRUCT { @@ -85,7 +83,7 @@ :ItemConstructor a sp:Construct, sp:Query ; sp:text """ - PREFIX dh: + PREFIX dh: PREFIX sioc: CONSTRUCT { diff --git a/src/main/resources/com/atomgraph/linkeddatahub/lapp.ttl b/src/main/resources/com/atomgraph/linkeddatahub/lapp.ttl deleted file mode 100644 index fe0acaa791..0000000000 --- a/src/main/resources/com/atomgraph/linkeddatahub/lapp.ttl +++ /dev/null @@ -1,214 +0,0 @@ -@base . - -@prefix : <#> . -@prefix ldh: . -@prefix a: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix ldt: . -@prefix sp: . -@prefix spin: . -@prefix spl: . -@prefix void: . -@prefix foaf: . -@prefix dct: . - -: a owl:Ontology ; - owl:imports ldh:, ldt:, sp:, spin: ; - rdfs:label "LinkedDataHub application ontology" ; - rdfs:comment "Ontology of LinkedDataHub applications" ; - owl:versionInfo "1.1.4" . - -# PROPERTIES - -:origin a owl:ObjectProperty, owl:FunctionalProperty, owl:InverseFunctionalProperty ; - rdfs:domain :Application ; - rdfs:range rdfs:Resource ; - rdfs:label "Origin" ; - rdfs:comment "The origin URI of an application, which serves as the base URI for all resources in the application's dataspace" ; - rdfs:isDefinedBy : . - -:application a owl:ObjectProperty, owl:FunctionalProperty ; - rdfs:range :Application ; - rdfs:label "Application" ; - rdfs:comment "Links a resource to an application" ; - rdfs:isDefinedBy : . - -:frontendProxy a owl:ObjectProperty ; - rdfs:domain :Dataset ; - rdfs:range rdfs:Resource ; - rdfs:label "Frontend proxy" ; - rdfs:comment "An intermediary server (such as cache) that proxies frontend requests to service" ; - rdfs:isDefinedBy : . - -:backendProxy a owl:ObjectProperty ; - rdfs:domain :Dataset ; - rdfs:range rdfs:Resource ; - rdfs:label "Backend proxy" ; - rdfs:comment "An intermediary server (such as cache) that proxies backend requests to service" ; - rdfs:isDefinedBy : . - -:public a owl:DatatypeProperty ; - rdfs:domain :EndUserApplication ; - rdfs:range xsd:boolean ; - rdfs:label "Public" ; - rdfs:comment "If true, this application can be listed as public (ACL still applies). If false, it is private and will not be listed" ; - rdfs:isDefinedBy : . - -:allowRead a owl:DatatypeProperty ; - rdfs:domain :Application ; - rdfs:range xsd:boolean ; - rdfs:label "Allow read" ; - rdfs:comment "If true, this application allows GET an HEAD methods for all request URIs without authorization check" ; - rdfs:isDefinedBy : . - -# CLASSES - -# dataset - -:Dataset a rdfs:Class, owl:Class ; - rdfs:subClassOf void:Dataset ; - rdfs:label "Linked Data dataset" ; - rdfs:comment "A dataspace that returns RDF Linked Data" ; - rdfs:isDefinedBy : . - -# application - -:Application a rdfs:Class, owl:Class ; - rdfs:subClassOf ldt:Application ; - spin:constructor :ApplicationConstructor ; - spin:constraint :StartsWithHTTPS, :ValidOrigin, - [ a ldh:MissingPropertyValue ; - rdfs:label "Missing origin URI" ; - sp:arg1 :origin - ] ; - rdfs:label "Application" ; - rdfs:comment "An application represents a data space identified by its origin URI, in which application resource URIs are relative to the origin URI. The only application interface (API) is read-write RESTful Linked data, backed by an RDF dataset accessible as a SPARQL 1.1 service. Application structure is defined in an ontology, which can import other ontologies." ; - rdfs:isDefinedBy : . - -:ApplicationConstructor a ldh:Constructor ; - sp:text """ - PREFIX lapp: - PREFIX rdfs: - - CONSTRUCT { - $this lapp:origin [ a rdfs:Resource ] . - } - WHERE { - }""" ; - rdfs:label "Application constructor" ; - rdfs:isDefinedBy : . - -# end-user - -:EndUserApplication a rdfs:Class, owl:Class ; - spin:constructor :EndUserApplicationConstructor ; - rdfs:label "End-user application" ; - rdfs:comment "Application with a dynamic access control and sitemap" ; - rdfs:isDefinedBy : . - -:EndUserApplicationConstructor a ldh:Constructor ; - sp:text """ - PREFIX lapp: - PREFIX ldh: - PREFIX ac: - PREFIX xsd: - PREFIX ldt: - PREFIX dct: - - CONSTRUCT { - $this dct:title [ a xsd:string ] ; - dct:description [ a xsd:string ] ; - ac:stylesheet [ a ldh:File ] ; - lapp:public [ a xsd:boolean ] . - } - WHERE {}""" ; - rdfs:label "End-user application constructor" ; - rdfs:isDefinedBy : . - -# admin - -:AdminApplication a rdfs:Class, owl:Class ; - spin:constructor :AdminApplicationConstructor ; - rdfs:label "Admin application" ; - rdfs:comment "Meta-application that manages the access control and sitemap of the main end-user application" ; - rdfs:isDefinedBy : . - -:AdminApplicationConstructor a ldh:Constructor ; - sp:text """ - PREFIX xsd: - PREFIX dct: - - CONSTRUCT { - $this dct:title [ a xsd:string ] ; - dct:description [ a xsd:string ] ; - } - WHERE {}""" ; - rdfs:label "Admin application constructor" ; - rdfs:isDefinedBy : . - -# package - -:Package a rdfs:Class, owl:Class ; - rdfs:label "Package" ; - rdfs:comment "A reusable package containing RDF ontology and optional XSLT stylesheet for vocabulary support" ; - rdfs:isDefinedBy : . - -# CONSTRAINTS - -:StartsWithHTTPS a sp:Construct ; - rdfs:label "lapp:origin starts with https://" ; - sp:text """ -PREFIX lapp: -PREFIX spin: -PREFIX rdfs: - -CONSTRUCT { - _:c0 a spin:ConstraintViolation . - _:c0 spin:violationRoot ?this . - _:c0 spin:violationPath lapp:origin . - _:c0 rdfs:label "Application origin URI must start with https://" . -} -WHERE { - ?this lapp:origin ?origin - FILTER ( ! strstarts(str(?origin), "https://") ) -}""" ; - rdfs:isDefinedBy : . - -:ValidOrigin a sp:Construct ; - rdfs:label "Origin must not have trailing slash and must have hostname" ; - sp:text """ -PREFIX lapp: -PREFIX spin: -PREFIX rdfs: - -CONSTRUCT - { - _:c0 a spin:ConstraintViolation . - _:c0 spin:violationRoot ?this . - _:c0 spin:violationPath lapp:origin . - _:c0 rdfs:label ?message . - } -WHERE - { - ?this lapp:origin ?origin . - - BIND(STRAFTER(str(?origin), "//") AS ?afterScheme) - BIND(IF(CONTAINS(?afterScheme, "/"), - STRBEFORE(?afterScheme, "/"), - ?afterScheme) AS ?hostname) - - BIND( - IF(STRENDS(str(?origin), "/"), - "Origin URL must not end with a trailing slash", - IF(?hostname = "", - "Origin URL must have a non-empty hostname", - "")) AS ?message - ) - - FILTER(?message != "") - } -""" ; - rdfs:isDefinedBy : . \ No newline at end of file diff --git a/src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl b/src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl index 4f1dd03e54..68766a73de 100644 --- a/src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl +++ b/src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl @@ -7,8 +7,7 @@ @prefix rdfs: . @prefix xsd: . @prefix owl: . -@prefix ldt: . -@prefix dh: . +@prefix dh: . @prefix sd: . @prefix sp: . @prefix spin: . @@ -596,7 +595,7 @@ ac:ChartMode a ac:Mode, ac:ContainerMode ; ### EXTERNAL ASSERTIONS -# https://www.w3.org/ns/ldt/document-hierarchy +# https://w3id.org/atomgraph/linkeddatahub/document-hierarchy dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTopicConstructor, :BlockConstructor . @@ -752,7 +751,7 @@ sd:Service spin:constructor :ServiceConstructor ; :ServiceConstructor a :Constructor ; sp:text """ PREFIX a: - PREFIX lapp: + PREFIX lds: PREFIX rdfs: PREFIX xsd: PREFIX sd: @@ -763,7 +762,7 @@ sd:Service spin:constructor :ServiceConstructor ; a:graphStore [ a rdfs:Resource ] ; a:authUser [ a xsd:string ] ; a:authPwd [ a xsd:string ] ; - lapp:proxy [ a rdfs:Resource ] . + lds:proxy [ a rdfs:Resource ] . } WHERE {}""" ; rdfs:label "Service constructor" ; diff --git a/src/main/resources/com/atomgraph/linkeddatahub/lds.ttl b/src/main/resources/com/atomgraph/linkeddatahub/lds.ttl new file mode 100644 index 0000000000..c0a3274980 --- /dev/null +++ b/src/main/resources/com/atomgraph/linkeddatahub/lds.ttl @@ -0,0 +1,238 @@ +@base . + +@prefix : <#> . +@prefix ldh: . +@prefix a: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix sd: . +@prefix sp: . +@prefix spin: . +@prefix spl: . +@prefix void: . +@prefix foaf: . +@prefix dct: . +@prefix doap: . + +: a owl:Ontology ; + owl:imports ldh:, sd:, sp:, spin: ; + rdfs:label "LinkedDataHub dataspace ontology" ; + rdfs:comment "Ontology of LinkedDataHub dataspaces" ; + owl:versionInfo "2.0.0" . + +# PROPERTIES + +:origin a owl:ObjectProperty, owl:FunctionalProperty, owl:InverseFunctionalProperty ; + rdfs:domain :Dataspace ; + rdfs:range rdfs:Resource ; + rdfs:label "Origin" ; + rdfs:comment "The origin URI of a dataspace, which serves as the base URI for all resources in it" ; + rdfs:isDefinedBy : . + +:dataspace a owl:ObjectProperty, owl:FunctionalProperty ; + rdfs:range :Dataspace ; + rdfs:label "Dataspace" ; + rdfs:comment "Links a resource to a dataspace" ; + rdfs:isDefinedBy : . + +:base a owl:ObjectProperty, owl:FunctionalProperty ; + rdfs:domain :Dataspace ; + rdfs:label "Base URI" ; + rdfs:comment "The base URI all of the dataspace's resource URIs are relative to" ; + rdfs:isDefinedBy : . + +:ontology a owl:ObjectProperty, owl:FunctionalProperty ; + rdfs:range owl:Ontology ; + rdfs:label "Ontology" ; + rdfs:comment "The ontology that defines the structure of a dataspace, or the vocabulary a package contributes" ; + rdfs:isDefinedBy : . + +:service a owl:ObjectProperty, owl:FunctionalProperty ; + rdfs:range sd:Service ; + rdfs:label "SPARQL service" ; + rdfs:comment "The service implementing SPARQL Protocol and Graph Store Protocol that backs a dataspace or a proxied dataset" ; + rdfs:isDefinedBy : . + +:backendProxy a owl:ObjectProperty ; + rdfs:domain :Dataset ; + rdfs:range rdfs:Resource ; + rdfs:label "Backend proxy" ; + rdfs:comment "An intermediary server (such as cache) that proxies backend requests to service" ; + rdfs:isDefinedBy : . + +:prefix a owl:ObjectProperty ; + rdfs:domain :Dataset ; + rdfs:range rdfs:Resource ; + rdfs:label "Prefix" ; + rdfs:comment "The URL path prefix under which this dataset is proxied" ; + rdfs:isDefinedBy : . + +:public a owl:DatatypeProperty ; + rdfs:domain :EndUserDataspace ; + rdfs:range xsd:boolean ; + rdfs:label "Public" ; + rdfs:comment "If true, this dataspace can be listed as public (ACL still applies). If false, it is private and will not be listed" ; + rdfs:isDefinedBy : . + +:allowRead a owl:DatatypeProperty ; + rdfs:domain :Dataspace ; + rdfs:range xsd:boolean ; + rdfs:label "Allow read" ; + rdfs:comment "If true, this dataspace allows GET and HEAD methods for all request URIs without authorization check" ; + rdfs:isDefinedBy : . + +:versioningRepository a owl:ObjectProperty ; + rdfs:domain :Dataspace ; + rdfs:range doap:GitRepository ; + rdfs:label "Versioning repository" ; + rdfs:comment "The git repository this dataspace commits its graph versions to. Absent, the dataspace is not versioned" ; + rdfs:isDefinedBy : . + +# CLASSES + +# dataset + +:Dataset a rdfs:Class, owl:Class ; + rdfs:subClassOf void:Dataset ; + rdfs:label "Linked Data dataset" ; + rdfs:comment "An external dataset that returns RDF Linked Data, proxied under a URL path prefix of this deployment" ; + rdfs:isDefinedBy : . + +# dataspace + +:Dataspace a rdfs:Class, owl:Class ; + spin:constructor :DataspaceConstructor ; + spin:constraint :StartsWithHTTPS, :ValidOrigin, + [ a ldh:MissingPropertyValue ; + rdfs:label "Missing origin URI" ; + sp:arg1 :origin + ] ; + rdfs:label "Dataspace" ; + rdfs:comment "A dataspace is identified by its origin URI, and the URIs of the resources it holds are relative to that origin. Its only interface (API) is read-write RESTful Linked Data, backed by an RDF dataset accessible as a SPARQL 1.1 service. Its structure is defined in an ontology, which can import other ontologies." ; + rdfs:isDefinedBy : . + +:DataspaceConstructor a ldh:Constructor ; + sp:text """ + PREFIX lds: + PREFIX rdfs: + + CONSTRUCT { + $this lds:origin [ a rdfs:Resource ] . + } + WHERE { + }""" ; + rdfs:label "Dataspace constructor" ; + rdfs:isDefinedBy : . + +# end-user + +:EndUserDataspace a rdfs:Class, owl:Class ; + spin:constructor :EndUserDataspaceConstructor ; + rdfs:label "End-user dataspace" ; + rdfs:comment "Dataspace with dynamic access control and sitemap" ; + rdfs:isDefinedBy : . + +:EndUserDataspaceConstructor a ldh:Constructor ; + sp:text """ + PREFIX lds: + PREFIX ldh: + PREFIX ac: + PREFIX xsd: + PREFIX dct: + + CONSTRUCT { + $this dct:title [ a xsd:string ] ; + dct:description [ a xsd:string ] ; + ac:stylesheet [ a ldh:File ] ; + lds:public [ a xsd:boolean ] . + } + WHERE {}""" ; + rdfs:label "End-user dataspace constructor" ; + rdfs:isDefinedBy : . + +# admin + +:AdminDataspace a rdfs:Class, owl:Class ; + spin:constructor :AdminDataspaceConstructor ; + rdfs:label "Admin dataspace" ; + rdfs:comment "Meta-dataspace that manages the access control and sitemap of the end-user dataspace it pairs with" ; + rdfs:isDefinedBy : . + +:AdminDataspaceConstructor a ldh:Constructor ; + sp:text """ + PREFIX xsd: + PREFIX dct: + + CONSTRUCT { + $this dct:title [ a xsd:string ] ; + dct:description [ a xsd:string ] ; + } + WHERE {}""" ; + rdfs:label "Admin dataspace constructor" ; + rdfs:isDefinedBy : . + +# package + +:Package a rdfs:Class, owl:Class ; + rdfs:label "Package" ; + rdfs:comment "A reusable package containing RDF ontology and optional XSLT stylesheet for vocabulary support" ; + rdfs:isDefinedBy : . + +# CONSTRAINTS + +:StartsWithHTTPS a sp:Construct ; + rdfs:label "lds:origin starts with https://" ; + sp:text """ +PREFIX lds: +PREFIX spin: +PREFIX rdfs: + +CONSTRUCT { + _:c0 a spin:ConstraintViolation . + _:c0 spin:violationRoot ?this . + _:c0 spin:violationPath lds:origin . + _:c0 rdfs:label "Dataspace origin URI must start with https://" . +} +WHERE { + ?this lds:origin ?origin + FILTER ( ! strstarts(str(?origin), "https://") ) +}""" ; + rdfs:isDefinedBy : . + +:ValidOrigin a sp:Construct ; + rdfs:label "Origin must not have trailing slash and must have hostname" ; + sp:text """ +PREFIX lds: +PREFIX spin: +PREFIX rdfs: + +CONSTRUCT + { + _:c0 a spin:ConstraintViolation . + _:c0 spin:violationRoot ?this . + _:c0 spin:violationPath lds:origin . + _:c0 rdfs:label ?message . + } +WHERE + { + ?this lds:origin ?origin . + + BIND(STRAFTER(str(?origin), "//") AS ?afterScheme) + BIND(IF(CONTAINS(?afterScheme, "/"), + STRBEFORE(?afterScheme, "/"), + ?afterScheme) AS ?hostname) + + BIND( + IF(STRENDS(str(?origin), "/"), + "Origin URL must not end with a trailing slash", + IF(?hostname = "", + "Origin URL must have a non-empty hostname", + "")) AS ?message + ) + + FILTER(?message != "") + } +""" ; + rdfs:isDefinedBy : . \ No newline at end of file diff --git a/src/main/resources/com/atomgraph/linkeddatahub/ldt.ttl b/src/main/resources/com/atomgraph/linkeddatahub/ldt.ttl deleted file mode 100644 index 120859f87f..0000000000 --- a/src/main/resources/com/atomgraph/linkeddatahub/ldt.ttl +++ /dev/null @@ -1,199 +0,0 @@ -@base . - -@prefix : <#> . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix sd: . -@prefix sp: . -@prefix spin: . -@prefix spl: . -@prefix dct: . -@prefix vann: . - -: a owl:Ontology ; - owl:imports , , sd: ; - owl:versionInfo "1.1.4" ; - rdfs:label "Linked Data Templates ontology" ; - rdfs:comment "Must be imported and reused by LDT applications" ; - dct:created "2012-10-26T01:04:00+03:00"^^xsd:dateTime ; - dct:modified "2012-12-19T02:29:00+03:00"^^xsd:dateTime, "2013-03-09T12:33:00+03:00"^^xsd:dateTime, "2014-08-24T02:04:00+02:00"^^xsd:dateTime, "2018-05-21T23:42:00+02:00"^^xsd:dateTime ; - vann:preferredNamespaceUri "https://www.w3.org/ns/ldt#" ; - vann:preferredNamespacePrefix "ldt"; - dct:license . - -# PROPERTIES - -# Application - -:base a owl:ObjectProperty, owl:FunctionalProperty ; - rdfs:domain :Application ; - rdfs:label "Base URI" ; - rdfs:comment "Base URI uniquely identifies the application" ; - rdfs:isDefinedBy : . - -:ontology a owl:ObjectProperty, owl:FunctionalProperty ; - rdfs:domain :Application ; - rdfs:range :Ontology ; - rdfs:label "Ontology" ; - rdfs:comment "Application ontology with domain classes and LDT templates" ; - rdfs:isDefinedBy : . - -:service a owl:ObjectProperty, owl:FunctionalProperty ; - rdfs:domain :Application ; - rdfs:range sd:Service ; - rdfs:label "SPARQL service" ; - rdfs:comment "Service implementing SPARQL Protocol and Graph Store Protocol" ; - rdfs:isDefinedBy : . - -# hypermedia - -:arg a owl:ObjectProperty ; - rdfs:domain :View ; - rdfs:label "Argument" ; - rdfs:comment "Template call argument" ; - rdfs:isDefinedBy : . - -:paramName a owl:DatatypeProperty ; - rdfs:range xsd:string ; - rdfs:label "Parameter name" ; - rdfs:comment "Local name of the parameter property" ; - rdfs:isDefinedBy : . - -# Class - -:path a owl:AnnotationProperty, :InheritedProperty ; - # rdfs:domain rdfs:Class ; - # rdfs:range xsd:string ; - rdfs:label "Path" ; - rdfs:comment "Base-relative URI template for URI building (JAX-RS syntax)" ; - rdfs:seeAlso , - ; - rdfs:isDefinedBy : . - -:fragment a owl:AnnotationProperty, :InheritedProperty ; - # rdfs:domain rdfs:Class ; - # rdfs:range xsd:string ; - rdfs:label "Fragment" ; - rdfs:comment "URI fragment template for blank node skolemization (JAX-RS syntax)" ; - rdfs:seeAlso , - ; - rdfs:isDefinedBy : . - -# Template - -:extends a owl:ObjectProperty ; - rdfs:domain :Template ; - rdfs:range :Template ; - rdfs:label "Extends" ; - rdfs:comment "Super-template from which this template will inherit properties" ; - rdfs:isDefinedBy : . - -:match a owl:DatatypeProperty, :InheritedProperty ; - rdfs:domain :Template ; - rdfs:range xsd:string ; - rdfs:label "Match" ; - rdfs:comment "Base-relative URI template for URI matching (JAX-RS syntax)" ; - rdfs:seeAlso ; - rdfs:isDefinedBy : . - -:query a owl:ObjectProperty, :InheritedProperty ; - rdfs:subPropertyOf spin:query ; - rdfs:domain :Template ; - rdfs:range :Query ; - rdfs:label "Query" ; - rdfs:comment "SPIN query to retrieve resource description (DESCRIBE or CONSTRUCT)" ; - rdfs:isDefinedBy : . - -:update a owl:ObjectProperty, :InheritedProperty ; - rdfs:subPropertyOf spin:update ; - rdfs:domain :Template ; - rdfs:range :Update ; - rdfs:label "Update" ; - rdfs:comment "SPIN update to remove resource description" ; - rdfs:isDefinedBy : . - -:param a owl:ObjectProperty ; - rdfs:domain :Template ; - rdfs:range :Parameter ; - rdfs:label "Parameter" ; - rdfs:comment "Template parameter" ; - rdfs:seeAlso spin:constraint ; - rdfs:isDefinedBy : . - -:priority a owl:DatatypeProperty, :InheritedProperty ; - rdfs:domain :Template ; - rdfs:range xsd:float ; - rdfs:label "Priority" ; - rdfs:comment "Template priority (overrides URI template priority)" ; - rdfs:seeAlso ; - rdfs:isDefinedBy : . - -:cacheControl a owl:DatatypeProperty, :InheritedProperty ; - rdfs:domain :Template ; - rdfs:range xsd:string ; - rdfs:label "Cache control" ; - rdfs:comment "Value of the HTTP Cache-Control response header" ; - rdfs:seeAlso ; - rdfs:isDefinedBy : . - -:loadClass a owl:ObjectProperty, :InheritedProperty ; - rdfs:domain :Template ; - rdfs:label "Load class"; - rdfs:comment "Indicates the Java class that will handle requests matched by this template. Needs to start with 'java:' URI scheme." ; - rdfs:seeAlso ; - rdfs:isDefinedBy : . - -:lang a owl:ObjectProperty, :InheritedProperty ; - rdfs:domain :Template ; - rdfs:range rdf:List ; - rdfs:label "Content language" ; - rdfs:comment "List of BCP 47 language tags" ; - rdfs:seeAlso ; - rdfs:isDefinedBy : . - -# CLASSES - -:InheritedProperty a rdfs:Class, owl:Class ; - rdfs:subClassOf owl:AnnotationProperty ; - rdfs:label "Inherited property" ; - rdfs:comment "Values of this property are inherited by subclasses that do not have this property" ; - rdfs:isDefinedBy : . - -:Application a rdfs:Class, owl:Class ; - rdfs:label "Application" ; - rdfs:comment "Declarative Linked Data application which structure is defined by its ontology and data is access via its SPARQL service" ; - rdfs:isDefinedBy : . - -:Ontology a rdfs:Class, owl:Class ; - rdfs:subClassOf owl:Ontology ; - rdfs:label "Ontology" ; - rdfs:comment "Ontology annotated with Linked Data Templates" ; - rdfs:isDefinedBy : . - -:Template a rdfs:Class, owl:Class ; - rdfs:label "Resource template" ; - rdfs:comment "A class of RDF resources that share the same URI template and SPARQL query template" ; - rdfs:isDefinedBy : . - -:Query a rdfs:Class, owl:Class ; - rdfs:subClassOf sp:Query, [ a owl:Class ; - owl:unionOf (sp:Describe sp:Construct) ; - rdfs:label "Graph query forms" - ] ; - rdfs:label "Query" ; - rdfs:isDefinedBy : . - -:Update a rdfs:Class, owl:Class ; - rdfs:subClassOf sp:Update ; - rdfs:label "Update" ; - rdfs:isDefinedBy : . - -:Parameter a rdfs:Class, owl:Class ; - rdfs:subClassOf spl:Argument ; - rdfs:label "Parameter" ; - rdfs:comment "Represents a query parameter that has predicate, value type, default value etc." ; - rdfs:isDefinedBy : . - -spl:Argument a spin:ConstructTemplate . \ No newline at end of file diff --git a/src/main/resources/com/linkeddatahub/packages/editor/taxonomy/package.ttl b/src/main/resources/com/linkeddatahub/packages/editor/taxonomy/package.ttl index be0aa2119d..3e695b39be 100644 --- a/src/main/resources/com/linkeddatahub/packages/editor/taxonomy/package.ttl +++ b/src/main/resources/com/linkeddatahub/packages/editor/taxonomy/package.ttl @@ -1,18 +1,17 @@ @base . @prefix : <#> . -@prefix lapp: . -@prefix ldt: . +@prefix lds: . @prefix ac: . @prefix rdfs: . @prefix dct: . @prefix foaf: . - a lapp:Package ; + a lds:Package ; rdfs:label "Taxonomy Editor" ; dct:title "Taxonomy Editor for LinkedDataHub" ; dct:description "Turns a dataspace into a taxonomy editor: SKOS concepts, schemes and collections gain a concept tree beside the content, hierarchy views that read both assertion directions, and constructors and constraints that keep a concept labelled and in a scheme." ; dct:creator ; - ldt:ontology ; + lds:ontology ; # the published copy, which the application takes its own copy of at import and then serves from # its own origin - so what a running instance compiles cannot change under it afterwards ac:stylesheet . diff --git a/src/main/resources/prefix-mapping.ttl b/src/main/resources/prefix-mapping.ttl index 9079d06776..3c982e15c3 100644 --- a/src/main/resources/prefix-mapping.ttl +++ b/src/main/resources/prefix-mapping.ttl @@ -5,16 +5,13 @@ # LinkedDataHub's own vocabularies - the application ontology closure starts at default# [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub" ; lm:altName "com/atomgraph/linkeddatahub/ldh.ttl" ] , [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/default" ; lm:altName "com/atomgraph/linkeddatahub/def.ttl" ] , - [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/apps" ; lm:altName "com/atomgraph/linkeddatahub/lapp.ttl" ] , + [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/dataspaces" ; lm:altName "com/atomgraph/linkeddatahub/lds.ttl" ] , [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/admin" ; lm:altName "com/atomgraph/linkeddatahub/app/admin/adm.ttl" ] , [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/admin/acl" ; lm:altName "com/atomgraph/linkeddatahub/app/admin/lacl.ttl" ] , + [ lm:prefix "https://w3id.org/atomgraph/linkeddatahub/document-hierarchy" ; lm:altName "com/atomgraph/linkeddatahub/dh.ttl" ] , [ lm:prefix "https://w3id.org/atomgraph/client" ; lm:altName "com/atomgraph/client/ns.ttl" ] , - # Linked Data Templates - [ lm:prefix "https://www.w3.org/ns/ldt" ; lm:altName "com/atomgraph/linkeddatahub/ldt.ttl" ] , - [ lm:prefix "https://www.w3.org/ns/ldt/document-hierarchy" ; lm:altName "com/atomgraph/linkeddatahub/dh.ttl" ] , - - # SPIN - imported by ldh, def, lapp, ldt, dh and lacl + # SPIN - imported by ldh, def, lds, dh and lacl [ lm:prefix "http://spinrdf.org/sp" ; lm:altName "etc/sp.ttl" ] , [ lm:prefix "http://spinrdf.org/spin" ; lm:altName "etc/spin.ttl" ] , diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/admin/signup.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/admin/signup.xsl index 20d80f51c2..e64ea3dede 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/admin/signup.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/admin/signup.xsl @@ -3,7 +3,7 @@ - + @@ -13,8 +13,7 @@ - - + @@ -30,14 +29,13 @@ xmlns:ac="∾" xmlns:a="&a;" xmlns:lacl="&lacl;" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:srx="&srx;" xmlns:http="&http;" xmlns:acl="&acl;" xmlns:cert="&cert;" -xmlns:core="&c;" xmlns:dh="&dh;" xmlns:dct="&dct;" xmlns:foaf="&foaf;" @@ -46,7 +44,7 @@ xmlns:spin="&spin;" xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="#all"> - +
    @@ -55,17 +53,17 @@ exclude-result-prefixes="#all"> - + - + - + - + - + @@ -81,16 +79,16 @@ exclude-result-prefixes="#all"> - + - + - + @@ -98,7 +96,7 @@ exclude-result-prefixes="#all"> - + @@ -121,7 +119,7 @@ exclude-result-prefixes="#all"> - + @@ -137,7 +135,7 @@ exclude-result-prefixes="#all"> - + @@ -146,7 +144,7 @@ exclude-result-prefixes="#all"> - + @@ -187,10 +185,10 @@ exclude-result-prefixes="#all"> - + - + @@ -267,7 +265,7 @@ exclude-result-prefixes="#all"> - + @@ -279,13 +277,13 @@ exclude-result-prefixes="#all"> - + - + \ No newline at end of file diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl index 453d12c1b6..a1ec6013c7 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl @@ -1,6 +1,6 @@ + @@ -15,7 +15,7 @@ - + @@ -42,7 +42,7 @@ xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:saxon="http://saxon.sf.net/" xmlns:a="&a;" xmlns:ac="∾" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:ldh="&ldh;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" @@ -99,7 +99,7 @@ extension-element-prefixes="ixsl" - + @@ -310,7 +310,7 @@ WHERE - + @@ -336,7 +336,7 @@ WHERE - + @@ -352,11 +352,11 @@ WHERE - + - + @@ -415,7 +415,7 @@ WHERE - + @@ -520,7 +520,7 @@ WHERE - + @@ -555,7 +555,7 @@ WHERE - + @@ -1080,7 +1080,7 @@ WHERE - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block.xsl index be6548e569..da5aabea0d 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block.xsl @@ -2,14 +2,14 @@ - + - + @@ -30,7 +30,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:geo="&geo;" @@ -1170,7 +1170,7 @@ exclude-result-prefixes="#all" - + ldh:load-object-metadata @@ -1254,7 +1254,7 @@ exclude-result-prefixes="#all" then distinct-values($response?body/rdf:RDF/rdf:Description/*/concat(namespace-uri(), local-name())) else ()"/> - + ldh:load-property-metadata diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/chart.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/chart.xsl index 0d32cb2e44..0f36583607 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/chart.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/chart.xsl @@ -2,7 +2,7 @@ - + @@ -26,7 +26,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:srx="&srx;" xmlns:acl="&acl;" diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/object.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/object.xsl index a6e0b010ba..4d111b59d4 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/object.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/object.xsl @@ -9,12 +9,12 @@ - + ]> - + - + - + @@ -26,7 +26,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:srx="&srx;" xmlns:acl="&acl;" diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/view.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/view.xsl index f2c7c7e4d5..bd95916d93 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/view.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/block/view.xsl @@ -2,7 +2,7 @@ - + @@ -27,7 +27,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:srx="&srx;" @@ -3227,7 +3227,7 @@ exclude-result-prefixes="#all" - + - + - @@ -26,7 +25,6 @@ xmlns:rdfs="&rdfs;" xmlns:owl="&owl;" xmlns:sparql="&sparql;" xmlns:sd="&sd;" -xmlns:c="&c;" xmlns:dct="&dct;" xmlns:foaf="&foaf;" xmlns:sioc="&sioc;" diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/constructor.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/constructor.xsl index bf5a4437ae..9d7aa074a4 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/constructor.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/constructor.xsl @@ -1,7 +1,7 @@ - + @@ -23,7 +23,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:srx="&srx;" @@ -86,7 +86,7 @@ exclude-result-prefixes="#all" ]]> @@ -212,7 +212,7 @@ exclude-result-prefixes="#all" - + @@ -297,7 +297,7 @@ exclude-result-prefixes="#all" @@ -403,7 +403,7 @@ exclude-result-prefixes="#all"
    - + @@ -562,7 +562,7 @@ exclude-result-prefixes="#all"
    - + @@ -585,7 +585,7 @@ exclude-result-prefixes="#all" , - + @@ -700,7 +700,7 @@ exclude-result-prefixes="#all" renderer passes the parsed object type, the object-kind toggle passes nothing at all - and a param default only covers the second --> - + @@ -820,8 +820,8 @@ exclude-result-prefixes="#all" - - + + @@ -930,7 +930,7 @@ exclude-result-prefixes="#all" - + @@ -1070,7 +1070,7 @@ exclude-result-prefixes="#all" - + @@ -1190,11 +1190,11 @@ exclude-result-prefixes="#all" - + - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/form.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/form.xsl index 7d2eddb0ee..f326c04cd3 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/form.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/form.xsl @@ -2,14 +2,14 @@ - + - + @@ -33,7 +33,7 @@ xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:dct="&dct;" @@ -914,7 +914,7 @@ WHERE - + @@ -924,7 +924,7 @@ WHERE - + @@ -970,7 +970,7 @@ WHERE - + @@ -1019,7 +1019,7 @@ WHERE - + @@ -1045,7 +1045,7 @@ WHERE - + @@ -1107,16 +1107,16 @@ WHERE - + - + - + @@ -1925,7 +1925,7 @@ WHERE - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/functions.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/functions.xsl index f72bedd3eb..1437f9bb47 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/functions.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/functions.xsl @@ -1,6 +1,6 @@ + @@ -22,7 +22,7 @@ xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:fn="http://www.w3.org/2005/xpath-functions" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:ac="∾" xmlns:ldh="&ldh;" xmlns:rdf="&rdf;" @@ -84,14 +84,14 @@ exclude-result-prefixes="#all" + lds:base() and sd:endpoint() read the active one, so the lookup lives here once --> - + - + @@ -165,10 +165,10 @@ exclude-result-prefixes="#all" - + - + @@ -188,8 +188,8 @@ exclude-result-prefixes="#all" - - + + @@ -639,7 +639,7 @@ exclude-result-prefixes="#all" - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/hooks.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/hooks.xsl index d99fecd315..7be52048df 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/hooks.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/hooks.xsl @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -29,7 +29,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:ac="∾" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:sd="&sd;" exclude-result-prefixes="#all" > @@ -71,7 +71,7 @@ exclude-result-prefixes="#all" - + - + ]> - + @@ -14,7 +14,7 @@ xmlns:ixsl="http://saxonica.com/ns/interactiveXSLT" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:ldh="&ldh;" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:ac="∾" xmlns:rdf="&rdf;" xmlns:prov="&prov;" diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/modal.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/modal.xsl index 0c19ef4653..6ecf1947d4 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/modal.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client/modal.xsl @@ -1,6 +1,6 @@ + @@ -10,7 +10,7 @@ - + @@ -30,7 +30,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:json="http://www.w3.org/2005/xpath-functions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" -xmlns:lapp="&lapp;" +xmlns:lds="&lds;" xmlns:ac="∾" xmlns:ldh="&ldh;" xmlns:rdf="&rdf;" @@ -373,7 +373,7 @@ LIMIT 10 - + @@ -444,7 +444,7 @@ LIMIT 10 - +
    @@ -726,8 +726,8 @@ LIMIT 10 + always scoped to the page origin anyway); using lds:base() here previously broke in proxy + mode where lds:base() is the proxied app's base, not the page's. --> @@ -1077,7 +1077,7 @@ LIMIT 10 - + @@ -1120,7 +1120,7 @@ LIMIT 10 -