agroportal / project-management

Repository used to consolidate documentation about the AgroPortal project and track content related issues.
http://agroportal.lirmm.fr
7 stars 0 forks source link

See why DATE_ROLE from IOVAPortal does not parse #466

Open jonquet opened 5 months ago

jonquet commented 5 months ago

Discussed with @BaptisteCecconi

Loaded on our staging box for testing: https://stageportal.lirmm.fr/ontologies/DATE_ROLE

Classes does not display. In fact, this resource is a pure RDF file which simply declare a owl:Ontology But it uses uses RDF-S to declare properties.

Capture d’écran 2024-01-11 à 19 19 45

Still its parsed well by the OWL-API either in AgroPortal or in Protégé:

Capture d’écran 2024-01-11 à 19 22 40

What shall be our behvious for this ?

jonquet commented 5 months ago

In fact, this is an ontology of properties only.... defined at the RDF-S level.

But in our case we should at least display ALL the properties in the property tab

Capture d’écran 2024-01-11 à 19 28 12

For the moment we only display some : the ones that are either declared as owl:AnnotationProperty e.g. title Ot the ones simply used within the description of one object (property inthis case) e.g., voasem:useInstead that OWL-API also consider as annotation property.

jonquet commented 5 months ago

For better extraction and description of the resource, @BaptisteCecconi shall certainly include a few metadata property. See MOD https://github.com/FAIR-IMPACT/MOD (but this is another topic)

jonquet commented 5 months ago

@syphax-bouazzouni @jvendetti What do you think? Shall that be something for the OWL-API no ? I mean, in theory the OWL-API should be able to manage properties declared as rdfs:Property ...

jonquet commented 5 months ago

@BaptisteCecconi a qucik fix for you, a good practice though... is to decide to declare your properties as owl:DataProperty or ObjectProperty => in your case DataProperty shall be ok ... as the range is a supposed to be a xsd:Date Then you will see then in Protégé.

Capture d’écran 2024-01-11 à 19 42 51
syphax-bouazzouni commented 5 months ago

@syphax-bouazzouni @jvendetti What do you think? Shall that be something for the OWL-API no ? I mean, in theory the OWL-API should be able to manage properties declared as rdfs:Property ...

The issue here, I think is in our reasoner (the owlapi one), as owl:AnnotationProperty is a rdf:subClass of rdf:Property (see screenshot below of the original owl.rdf specification), so we should display rdf:Properties as owl:AnnotationProperties by default as inferred by our reasoner.

image
jonquet commented 5 months ago

@syphax-bouazzouni Not sure what you mean. The reasonner will infer an owl:AnnoationProperty is a rdf:Property . But it does not infer anything for object that are only rdf:Property ... which is the case of a bunch of objects in this DATE_ROLE ontology. I mean, our backend/model assume the to return OWL properties to the UI ... (Object, Data, Annotation) but.. I guess things that are not typed as an owl:Property are ignored... and this is what I think we should change.

BaptisteCecconi commented 5 months ago

Hi @jonquet and @syphax-bouazzouni, As Clement wrote, the vocabularies developed in the IVOA context include rdf:Property declarations.

1st: I tried to modify my ontology and replace rdf:Property by owl:DataProperty. It plays well with Protege indeed, but it doesn't seem to appear correctly in OntoPortal anyway. So wouldn't it be something else ?

2nd: I talked with my IVOA Semantics WG colleagues, and there is no common wish to have a more complex description. Since our decisions are consensus based, it will be difficult to move to owl:DataProperty definitions is the short term. We surely can test in the frame of the FAIR-IMPACT prototype, but it would be good to check if we can just keep simple rdf:Property.

jvendetti commented 5 months ago

I mean, our backend/model assume the to return OWL properties to the UI ... (Object, Data, Annotation) but.. I guess things that are not typed as an owl:Property are ignored...

I'm not sure I understood you correctly. I wrote a snippet of OWL API code that prints the counts and IRIs for data, object, and annotation properties:

@Test
public void testIVOA_ROLES_DATES() throws Exception {
  File file = new File("src/test/resources/date_role.rdf");
  IRI iri = IRI.create(file);
  OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  OWLOntology ontology = manager.loadOntology(iri);
  assertNotNull(ontology);

  Set<OWLDataProperty> dataPropertySet = ontology.getDataPropertiesInSignature();
  System.out.println("Data property count: " + dataPropertySet.size());
  dataPropertySet.forEach(dataProp -> System.out.println(dataProp.getIRI()));

  Set<OWLObjectProperty> objectPropertySet = ontology.getObjectPropertiesInSignature();
  System.out.println("Object property count: " + objectPropertySet.size());
  objectPropertySet.forEach(objectProp -> System.out.println(objectProp.getIRI()));

  Set<OWLAnnotationProperty> annotationPropertySet = ontology.getAnnotationPropertiesInSignature();
  System.out.println("Annotation property count: " + annotationPropertySet.size());
  annotationPropertySet.forEach(annotationProp -> System.out.println(annotationProp.getIRI()));
}

The resulting output is:

Data property count: 0
Object property count: 0
Annotation property count: 11
http://purl.org/dc/terms/created
http://purl.org/dc/terms/creator
http://purl.org/dc/terms/description
http://purl.org/dc/terms/license
http://purl.org/dc/terms/title
http://www.ivoa.net/rdf/ivoasem#deprecated
http://www.ivoa.net/rdf/ivoasem#useInstead
http://www.ivoa.net/rdf/ivoasem#vocflavour
http://www.w3.org/2000/01/rdf-schema#comment
http://www.w3.org/2000/01/rdf-schema#label
http://xmlns.com/foaf/0.1/name

I assume what you mean is that the OWL API doesn't recognize rdf:Description elements that are specified as type http://www.w3.org/1999/02/22-rdf-syntax-ns#Property, as any sort of property object in the ontology signature?

I wrote a similar snippet of code using Apache Jena:

@Test
public void testLoad_DateRoleOntology() {
  String inputFileName = "src/test/resources/date_role.rdf";
  OntModel model = ModelFactory.createOntologyModel();
  InputStream in = RDFDataMgr.open(inputFileName);
  if (in == null) {
    throw new IllegalArgumentException("File: " + inputFileName + " not found");
  }
  model.read(in, null);

  ExtendedIterator<OntProperty> allProperties = model.listAllOntProperties();
  while (allProperties.hasNext()) {
    OntProperty property = allProperties.next();
    System.out.println("OntProperty URI: " + property.getURI());
  }
}

The resulting output here is:

OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#rest
OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate
OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#subject
OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#object
OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#first
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Accepted
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Collected
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Created
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Submitted
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Updated
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Available
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Valid
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#creation
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#update
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Issued
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Copyrighted
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#Inspected
OntProperty URI: http://www.ivoa.net/rdf/voresource/date_role#representative
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#isDefinedBy
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#seeAlso
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#label
OntProperty URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#comment
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#range
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#subPropertyOf
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#domain
OntProperty URI: http://www.w3.org/2000/01/rdf-schema#subClassOf
OntProperty URI: http://purl.org/dc/terms/description
OntProperty URI: http://purl.org/dc/terms/title
OntProperty URI: http://purl.org/dc/terms/created
OntProperty URI: http://purl.org/dc/terms/creator

I believe this is the behavior you desire? I'm not sure where in the stack you're suggesting this could be addressed.

jonquet commented 5 months ago

Indeed, we could suppose the OWL-API and then Bio/AgroPortal would get all the properties as Jena does.

I can also understand the choice of the OWL-API to consider as AnnotationProperties the things from "outside" (reused from another vocabulary). But its kind of weird that an ontology defining properties end up not having all the properties it internally defines as not recognized/identified by the OWL-API.

Then shall we consider that a vocabulary defined at RDF level only (hence defining only properties) is not really a "vocabulary" citizen so that Bio/AgroPortal will process it well.

What do you think?

syphax-bouazzouni commented 5 months ago

it seems that this issue it open in OWL-API since 2020, https://github.com/owlcs/owlapi/issues/736