pyLODE icon indicating copy to clipboard operation
pyLODE copied to clipboard

Consistency between member URIs and HTML divs for named individuals

Open smarie opened this issue 3 years ago • 10 comments

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 ?

smarie avatar Apr 27 '21 21:04 smarie

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

  • Issue #130
  • Issue #86
  • Issue #30
  • Issue #20

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.

nicholascar avatar Apr 27 '21 23:04 nicholascar

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

smarie avatar Apr 28 '21 07:04 smarie

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 avatar Apr 28 '21 07:04 nicholascar

@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!

nicholascar avatar May 05 '21 13:05 nicholascar

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

smarie avatar May 07 '21 10:05 smarie

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

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

nicholascar avatar May 07 '21 10:05 nicholascar

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

smarie avatar May 07 '21 12:05 smarie

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?

FilippoVigani avatar Dec 29 '22 14:12 FilippoVigani

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

pedropaulofb avatar Jul 19 '23 14:07 pedropaulofb

Same here with 3.1.1, any updates on the topic?

ftorr29 avatar Mar 15 '24 14:03 ftorr29