RDFLib / pyLODE

An OWL ontology documentation tool using Python and templating, based on LODE
BSD 3-Clause "New" or "Revised" License
161 stars 70 forks source link

Consistency between member URIs and HTML divs for named individuals #133

Open smarie opened 3 years ago

smarie commented 3 years ago

I noticed in an ontology of ours that the div links for named individuals are based on the rdfs:label.

However the IRIs for members usually end with the named individual id, so even if the IRI resolves to the generated doc page, the last bit (#<id>) can not resolve to the named individual div on the PyLODE html page.

Maybe there is something to modify in the named individuals html divs so that the id can also be used as an alias for the div ? I do not know in html if such a thing is possible.

an example:

###  http://w3id.org/blah#Foo
:Foo a owl:NamedIndividual ;
                rdfs:label "The Great Foo";
.

In the members section, http://w3id.org/blah#Foo will be displayed. However #Foo is not a valid div in the html, since the corresponding named individual div is #TheGreatFoo. Maybe both #Foo and #TheGreatFoo could be valid ?

I hope this example makes the issue clearer ?

nicholascar commented 3 years ago

I think this is a specialised form of these issues which are all about the poor generation of fragment identifiers:

So clearly this is an important issue! Because it's high priority, I'll try and come up with a fix ASAP - today or tomorrow.

smarie commented 3 years ago

Oh sorry, I did not make the link with those issues. Thanks @nicholascar !

nicholascar commented 3 years ago

Have a look with at the latest release (2.9.1) and see if this solves your NI URI issues. I've tried to ensure consistent fragment generation for all Classes, Properties & Named Individuals.

nicholascar commented 3 years ago

@smarie can you try out release 2.9.2 now and see if that works? Keen to close any solved issues to get the Issue count down!

smarie commented 3 years ago

Oops sorry this is very far from my main activities so I get only 1h per week or less to work on ontologies My own open source lib users are also creating issues that I have to answer :) I'll do this asap

nicholascar commented 3 years ago

I get only 1h per week or less to work on ontologies

You need to have words with your bosses - this is cruelty!

smarie commented 3 years ago

So I checked now and I confirm that the issue is still there.

With this example ontology:

@prefix : <http://w3id.org/se/core/tzo#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://w3id.org/dummy> .

<http://w3id.org/dummy> rdf:type owl:Ontology ;
                               rdfs:label "Dummy Ontology" ;
                               dc:description """An ontology to describe an issue.""" .

###  http://w3id.org/blah#Foo
:Foo a owl:NamedIndividual ;
                rdfs:label "The Great Foo";
.

The generated doc contains this:

image

So the URI is correct. However if I create a w3id rule to redirect the namespace to the doc URL, it will look for div #Foo.

The issue is that the div id for named individual entities, currently defined using fid in your template:

<div class="entity named_individual" id="{{ fid }}">

is using an id generated from the rdfs label ("The Great Foo"), rather than the element id :Foo

image

So the URI can not resolve to a valid URL using a valid w3id rule

FilippoVigani commented 1 year ago

Are there any updates on this? Personally, I can't see named individuals divs generated at all. Was this something that was only available on 2.x.x?

pedropaulofb commented 1 year ago

I am having the same issue. I cannot generate documentation for any named individuals using version 3.0.5.

ftorr29 commented 4 months ago

Same here with 3.1.1, any updates on the topic?