Skip to content

Commit

Permalink
Fix RDF uri on publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
torleifg committed Nov 28, 2024
1 parent 78a7939 commit d95233c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/main/kotlin/no/fdk/dataservicecatalog/handler/RDFHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ class RDFHandler(private val repository: DataServiceRepository, private val prop
}
}

fun Model.addCatalog(catalogId: String, baseUri: String, organizationCatalogBaseUri: String, publisherUri: String) {
this.createResource(URIref.encode(baseUri.plus(catalogId))).addProperty(RDF.type, DCAT.Catalog)
fun Model.addCatalog(catalogId: String, baseUri: String, organizationCatalogUri: String, publisherUri: String) {
this.createResource(URIref.encode(baseUri.plus(catalogId)))
.addProperty(
DCTerms.publisher, ResourceFactory.createResource(URIref.encode(catalogId))
RDF.type, DCAT.Catalog
).addProperty(
DCTerms.publisher, ResourceFactory.createResource(URIref.encode(organizationCatalogUri.plus(catalogId)))
).addProperty(
DCTerms.title, ResourceFactory.createLangLiteral("Data service catalog ($catalogId)", "en")

Check warning on line 112 in src/main/kotlin/no/fdk/dataservicecatalog/handler/RDFHandler.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/no/fdk/dataservicecatalog/handler/RDFHandler.kt#L106-L112

Added lines #L106 - L112 were not covered by tests
)

this.createResource(URIref.encode(organizationCatalogBaseUri.plus(catalogId)))
this.createResource(URIref.encode(organizationCatalogUri.plus(catalogId)))
.addProperty(
RDF.type, FOAF.Agent
).addProperty(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class RDFHandlerTest {
foaf:page <http://page.com> .
<$baseUri/catalogs/$catalogId> rdf:type dcat:Catalog;
dct:publisher <$catalogId>;
dct:publisher <$organizationCatalogBaseUri/organizations/$catalogId>;
dct:title "Data service catalog ($catalogId)"@en;
dcat:service <$baseUri/data-services/$dataServiceId> .
"""
Expand Down Expand Up @@ -166,7 +166,7 @@ class RDFHandlerTest {
foaf:page <http://page.com> .
<$baseUri/catalogs/$catalogId> rdf:type dcat:Catalog;
dct:publisher <$catalogId>;
dct:publisher <$organizationCatalogBaseUri/organizations/$catalogId>;
dct:title "Data service catalog ($catalogId)"@en;
dcat:service <$baseUri/data-services/$dataServiceId> .
"""
Expand Down

0 comments on commit d95233c

Please sign in to comment.