geolexica / geolexica-server

Generalized backend for Geolexica sites
2 stars 1 forks source link

Fix concept identifier for rdf format #185

Closed HassanAkbar closed 2 years ago

HassanAkbar commented 2 years ago

Fix concept identifier for rdf format

Old Format

# baseURI: "/concepts/147/"
# imports: http://purl.org/dc/terms/
# imports: https://www.geolexica.org/api/rdf-profile
# imports: http://www.w3.org/2004/02/skos/core

@prefix : </concepts/147/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdf-profile: </api/rdf-profile#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

</concepts/147/>
  rdf:type owl:Ontology ;
  owl:imports dcterms: ;
  owl:imports </api/rdf-profile> ;
  owl:imports <http://www.w3.org/2004/02/skos/core> ;
.
:closure
  rdf:type skos:Concept ;
  rdf-profile:engOrigin rdf-profile:English ;
  rdf-profile:termID </api/concepts/147.ttl> ;
  rdfs:label "geospatial metadata instance" ;
  skos:notation "147" ;
  skos:definition """single and specific metadata document, typically created in conformance with a metadata standard"""@en ;
  skos:inScheme rdf-profile:GeolexicaConceptScheme ;
  skos:prefLabel "geospatial metadata instance"@en ;
  :classification "preferred" ;
.
:linked-data-api
  rdf:type dcterms:MediaTypeOrExtent ;
  skos:prefLabel "linked-data-api" ;
.

New format

# baseURI: "http://localhost:4000/concepts/"
# imports: http://purl.org/dc/terms/
# imports: https://www.geolexica.org/api/rdf-profile
# imports: http://www.w3.org/2004/02/skos/core

@base <http://localhost:4000/concepts/> .
@prefix : <http://localhost:4000/concepts/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdf-profile: </api/rdf-profile#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://localhost:4000/concepts/>
  rdf:type owl:Ontology ;
  owl:imports dcterms: ;
  owl:imports </api/rdf-profile> ;
  owl:imports <http://www.w3.org/2004/02/skos/core> ;
.
<147>
  rdf:type skos:Concept ;
  rdf-profile:engOrigin rdf-profile:English ;
  rdf-profile:termID </api/concepts/147.ttl> ;
  rdfs:label "geospatial metadata instance" ;
  skos:notation "147" ;
  skos:definition """single and specific metadata document, typically created in conformance with a metadata standard"""@en ;
  skos:inScheme rdf-profile:GeolexicaConceptScheme ;
  skos:prefLabel "geospatial metadata instance"@en ;
  :classification "preferred" ;
.
:linked-data-api
  rdf:type dcterms:MediaTypeOrExtent ;
  skos:prefLabel "linked-data-api" ;
.

Turtle file output on SKOS Play

2022-08-18_14-04

closes #138

ronaldtse commented 2 years ago

Thanks @HassanAkbar , let’s merge this first.

In the near future, we should use the rdf-ruby library to generate this content instead of using a liquid template. We used a liquid template because initially we were under a compressed deadline.