Commit db620f11 authored by Élodie Thiéblin's avatar Élodie Thiéblin
Browse files

fix: add equivalent_uri triple with sameAs

otherwise, only the cubicweb "externalURI" was used "http://localhost:8080/uri/456"
parent 65ceb80050c0
......@@ -8,8 +8,8 @@
from cubicweb.entities.adapters import EntityRDFAdapter
from cubicweb.predicates import is_instance
from cubicweb.rdf import NAMESPACES
from rdflib import URIRef, OWL, RDFS
from rdflib import URIRef
class OWL2YamsGenericRDFAdapter(EntityRDFAdapter):
def triples(self):
......@@ -12,5 +12,8 @@
class OWL2YamsGenericRDFAdapter(EntityRDFAdapter):
def triples(self):
OWL = self._use_namespace("owl")
CW = self._use_namespace("cubicweb")
RDFS = self._use_namespace("rdfs")
{% for fragment, uri in entitytype_fragment_to_uri.items() %}
......@@ -16,4 +19,4 @@
{% for fragment, uri in entitytype_fragment_to_uri.items() %}
yield(NAMESPACES['cubicweb']["{{fragment}}"], OWL.equivalentClass, URIRef("{{uri}}"))
yield(CW["{{fragment}}"], OWL.equivalentClass, URIRef("{{uri}}"))
{% endfor %}
{% for fragment, uri in relationtype_fragment_to_uri.items() %}
......@@ -18,4 +21,4 @@
{% endfor %}
{% for fragment, uri in relationtype_fragment_to_uri.items() %}
yield(NAMESPACES['cubicweb']["{{fragment}}"], OWL.equivalentProperty, URIRef("{{uri}}"))
yield(CW["{{fragment}}"], OWL.equivalentProperty, URIRef("{{uri}}"))
{% endfor %}
......@@ -21,5 +24,8 @@
{% endfor %}
yield(NAMESPACES["cubicweb"]["name"], OWL.equivalentProperty, RDFS.label)
yield(CW["label"], OWL.equivalentProperty, RDFS.label)
yield(CW["equivalent_uri"], OWL.equivalentProperty, OWL.sameAs)
if self.entity.equivalent_uri:
yield (self.uri, OWL.sameAs, URIRef(self.entity.equivalent_uri[0].uri))
yield from super().triples()
{% for fragment, uri in entitytype_fragment_to_uri.items() %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment