enola-dev / enola

Enola 🕵🏾‍♀️ Holmes was an SRE.
https://docs.enola.dev/
Apache License 2.0
13 stars 5 forks source link

Handle RDF Collections (ordered list; rdf:first and rdf:rest) #759

Open vorburger opened 2 days ago

vorburger commented 2 days ago

Fix Enola to handle RDF Collections (i.e. ordered lists; with rdf:first and rdf:rest); as-is, it doesn't, yet:

java.lang.IllegalArgumentException: http://www.w3.org/2002/07/owl#withRestrictions
        at dev.enola.thing.message.ProtoThingIntoJavaThingBuilderConverter.object(ProtoThingIntoJavaThingBuilderConverter.java:107)
        at dev.enola.thing.message.ProtoThingIntoJavaThingBuilderConverter.convertInto(ProtoThingIntoJavaThingBuilderConverter.java:72)
        at dev.enola.thing.message.ProtoThingIntoJavaThingBuilderConverter.convertInto(ProtoThingIntoJavaThingBuilderConverter.java:41)
        at dev.enola.common.convert.ConverterInto.convertIntoOrThrow(ConverterInto.java:60)
        at dev.enola.rdf.RdfResourceIntoThingConverter.convert(RdfResourceIntoThingConverter.java:71)
        at dev.enola.rdf.RdfResourceIntoThingConverter.convert(RdfResourceIntoThingConverter.java:38)
        at dev.enola.thing.io.Loader.load(Loader.java:55)
(...)

for the ( ... ) in in following, from docs/models/linkml/owl/enola.linkml.owl.ttl (which also makes this a pre-req for #731) :

enola:wikipedia a owl:ObjectProperty,
        linkml:SlotDefinition ;
    rdfs:label "wikipedia" ;
    rdfs:range [ a rdfs:Datatype ;
            owl:onDatatype xsd:string ;
            owl:withRestrictions ( [ xsd:pattern "^[a-zA-Z0-9_]+$" ] ) ] ;
    skos:definition "Wikipedia EN page ID (not URL), e.g. 'Wikipedia' (for https://en.wikipedia.org/wiki/Wikipedia)" ;
    skos:inScheme enola:ontology .

Nota bene: https://rdf4j.org/documentation/programming/model/#rdf-collections