Skip to content

2024-11-09 Tre entità alla volta

  • Bugfix
    • Le entità non venivano create correttamente in caso shacl fosse None
    • Il contatore non veniva incrementato le entità annidate
    • In caso di entità annidate multiple per una stessa proprietà veniva generata solo l’ultima
    • Nella configurazione sulla visualizzazione la query sparql per la visualizzazione dell’identificatore era sbagliata e fondeva in un unico identificatore identificatori multipli in quando non c’era bind tra la variabile dell’identificatore e i vari URI degli identificatori associati a un’entità
  • Novità
    • I datatype invalidi vengono nascosti, non più disabilitati

    • Creazione entità proxy

      • Devono essere create tre entità
      - class: "http://purl.org/spar/fabio/JournalArticle"
      displayName: "Journal Article"
      displayProperties:
      - property: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
      values:
      - displayName: "Type"
      shouldBeDisplayed: true
      fetchValueFromQuery: null
      orderedBy: null
      - property: "http://purl.org/spar/datacite/hasIdentifier"
      values:
      - displayName: "Identifier"
      shouldBeDisplayed: true
      fetchValueFromQuery: |
      PREFIX datacite: <http://purl.org/spar/datacite/>
      PREFIX literal: <http://www.essepuntato.it/2010/06/literalreification/>
      SELECT (CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literal) AS ?id) ?identifier
      WHERE {
      [[subject]] datacite:hasIdentifier ?identifier.
      ?identifier datacite:usesIdentifierScheme ?scheme;
      literal:hasLiteralValue ?literal.
      }
      orderedBy: null
      - property: "http://purl.org/dc/terms/title"
      values:
      - displayName: "Title"
      shouldBeDisplayed: true
      fetchValueFromQuery: null
      orderedBy: null
      - property: "http://purl.org/spar/pro/isDocumentContextFor"
      intermediateRelation:
      class: "http://purl.org/spar/pro/RoleInTime"
      targetEntityType: "http://xmlns.com/foaf/0.1/Agent"
      values:
      - displayName: "Author"
      properties:
      - property: "http://purl.org/spar/pro/withRole"
      value: "http://purl.org/spar/pro/author"
      shouldBeDisplayed: true
      fetchValueFromQuery: |
      PREFIX pro: <http://purl.org/spar/pro/>
      PREFIX foaf: <http://xmlns.com/foaf/0.1/>
      SELECT DISTINCT ?formattedName ?ra WHERE {
      [[value]] pro:isHeldBy ?ra;
      pro:withRole pro:author.
      OPTIONAL { ?ra foaf:name ?name. }
      OPTIONAL { ?ra foaf:familyName ?familyName. }
      OPTIONAL { ?ra foaf:givenName ?givenName. }
      BIND(
      IF(BOUND(?name), ?name,
      IF(BOUND(?familyName) && BOUND(?givenName), CONCAT(?familyName, ", ", ?givenName),
      IF(BOUND(?familyName), CONCAT(?familyName, ","),
      IF(BOUND(?givenName), CONCAT(",", ?givenName), "")
      )
      )
      ) AS ?formattedName
      )
      }
      - displayName: "Publisher"
      properties:
      - property: "http://purl.org/spar/pro/withRole"
      value: "http://purl.org/spar/pro/publisher"
      shouldBeDisplayed: true
      fetchValueFromQuery: |
      PREFIX pro: <http://purl.org/spar/pro/>
      PREFIX foaf: <http://xmlns.com/foaf/0.1/>
      SELECT DISTINCT ?formattedName ?ra WHERE {
      [[value]] pro:isHeldBy ?ra;
      pro:withRole pro:publisher.
      OPTIONAL { ?ra foaf:name ?name. }
      OPTIONAL { ?ra foaf:familyName ?familyName. }
      OPTIONAL { ?ra foaf:givenName ?givenName. }
      BIND(
      IF(BOUND(?name), ?name,
      IF(BOUND(?familyName) && BOUND(?givenName), CONCAT(?familyName, ", ", ?givenName),
      IF(BOUND(?familyName), CONCAT(?familyName, ","),
      IF(BOUND(?givenName), CONCAT(",", ?givenName), "")
      )
      )
      ) AS ?formattedName
      )
      }
      - displayName: "Editor"
      properties:
      - property: "http://purl.org/spar/pro/withRole"
      value: "http://purl.org/spar/pro/editor"
      shouldBeDisplayed: true
      fetchValueFromQuery: |
      PREFIX pro: <http://purl.org/spar/pro/>
      PREFIX foaf: <http://xmlns.com/foaf/0.1/>
      SELECT DISTINCT ?formattedName ?ra WHERE {
      [[value]] pro:isHeldBy ?ra;
      pro:withRole pro:editor.
      OPTIONAL { ?ra foaf:name ?name. }
      OPTIONAL { ?ra foaf:familyName ?familyName. }
      OPTIONAL { ?ra foaf:givenName ?givenName. }
      BIND(
      IF(BOUND(?name), ?name,
      IF(BOUND(?familyName) && BOUND(?givenName), CONCAT(?familyName, ", ", ?givenName),
      IF(BOUND(?familyName), CONCAT(?familyName, ","),
      IF(BOUND(?givenName), CONCAT(",", ?givenName), "")
      )
      )
      ) AS ?formattedName
      )
      }
      orderedBy: "https://w3id.org/oc/ontology/hasNext"
      • La proprietà che connette class a targetEntityType viene automaticamente dedotta dallo shacl. Eventuali altre proprietà (pro:withRole) possono essere specificate per ciascuno valore di isDocumentContextFor
    • Creazione di proprietà ordinate

      • Modifica dell’ordine in tempo reale tramite handle
      • Numerazione dinamica
    • Ho ridisegnato l’interfaccia di creazione

      • Miglior raggruppamento per form distinti, con più spazio tra uno e l’altro
      • Gli item nei singoli form-group sono dentro un bordo chiaro
      • Handle + toggle e in fondo pulsante di eliminazione sulla stessa linea
    • Il numero minimo e massimo di valori per proprietà definito nello shacl si riflette sulla logica di comparsa e scomparsa dei pulsanti di cancellazione nell’interfaccia di creazione

    • Shape specializzate per le varie risorse bibliografiche

  • Ho eliminato a mano le triple problematica

    <#I> <#\u201EOkocim> " S.A. Notowanych Na Gie\u0142dzie Papier\u00F3w Warto\u015Bciowych W Warszawie" <https://w3id.org/oc/meta/br/> .
    <#Kliment> <#Ohridski> "" <https://w3id.org/oc/meta/ra/> .
    <#Carol> <#Davila> " Bucharest Romania Department Of Neurology " <#Dr> .
    <#Carol> <#Davila> " Central Military Emergency University Hospital Bucharest Romania" <https://w3id.org/oc/meta/ra/> .
    • Esteso il codice per raggruppare le entità da fondere in file diversi per evitare problemi di concorrenza. Per gli id era sufficiente raggruppare per id puntati dalle medesime entità. Per le br si è reso necessario raggruppare anche per entità comuni puntate. Entità = uri che è a sua volta soggetto di altre triple.
  • Test con Morph-KGC e PostgreSQL
    • infer_sql_datatypes: yes
  • Environment
    • morph_kgc==2.8.0 (2024-09-09) vs 1.3.5 (2021-10-13)
    • PostgreSQL 13 vs ?
Nome del TestPassatoMotivo del FallimentoR2RML Implementation Report
R2RMLTC0000YesYes
R2RMLTC0001aYesYes
R2RMLTC0001bYesYes
R2RMLTC0002aYesYes
R2RMLTC0002bYesYes
R2RMLTC0002cYesYes
R2RMLTC0002dYesYes
R2RMLTC0002eYesYes
R2RMLTC0002fNoEccezione gestitaNo
R2RMLTC0002gYesYes
R2RMLTC0002hYesYes
R2RMLTC0002iYesYes
R2RMLTC0002jYesYes
R2RMLTC0003bYesYes
R2RMLTC0003cYesYes
R2RMLTC0004aYesYes
R2RMLTC0004bYesYes
R2RMLTC0005aYesYes
R2RMLTC0005bYesYes
R2RMLTC0006aYesNo
R2RMLTC0007aYesYes
R2RMLTC0007bYesYes
R2RMLTC0007cYesYes
R2RMLTC0007dYesYes
R2RMLTC0007eYesYes
R2RMLTC0007fYesYes
R2RMLTC0007gYesYes
R2RMLTC0007hYesNo
R2RMLTC0008aYesYes
R2RMLTC0008bYesYes
R2RMLTC0008cYesYes
R2RMLTC0009aYesYes
R2RMLTC0009bYesYes
R2RMLTC0009cYesYes
R2RMLTC0009dNoDatatype su COUNTNo
R2RMLTC0010aYesYes
R2RMLTC0010bYesYes
R2RMLTC0010cYesNo
R2RMLTC0011aYesYes
R2RMLTC0011bYesYes
R2RMLTC0012aYesYes
R2RMLTC0012bYesYes
R2RMLTC0012cYesYes
R2RMLTC0012dNoTriplesMap with two subjectMap. Eccezione gestita, viene presa la secondaNo
R2RMLTC0012eYesYes
R2RMLTC0013aYesYes
R2RMLTC0014aYesYes
R2RMLTC0014bYesNo
R2RMLTC0014cYesNo
R2RMLTC0014dYesYes
R2RMLTC0015aYesYes
R2RMLTC0015bNomap with an invalid rr:language (english, spanish). Viene conservato il lang invalido nell’outputYes
R2RMLTC0016aYesYes
R2RMLTC0016bYesYes
R2RMLTC0016cNoViene inferito time anziché datetime, ma è anche vero che il valore inserito nel db non è datatimeNo
R2RMLTC0016dYesYes
R2RMLTC0016eNoNo
R2RMLTC0018aYesYes
R2RMLTC0019aNoNo
R2RMLTC0019bNoNo
R2RMLTC0020aNoNo
R2RMLTC0020bNoNo
  • Interfaccia per i test

  • I test mysql si rompono per colpa delle colonne non case-sensitive. Su rml i test sono tutti case insensitive per questo motivo. Inoltre richiedono delle query di upload diverse. Ad esempio

    # mysql
    USE r2rml;
    DROP TABLE IF EXISTS r2rml.Student;
    CREATE TABLE Student (
    Name VARCHAR(50)
    );
    # postgresql
    DROP TABLE IF EXISTS "Student" cascade;
    CREATE TABLE "Student" ("Name" varchar(50));
  • Perché usare GraphDB e non un grafo rdflib locale? Stiamo prendendo i dati rdf generati, li stiamo caricando su triplestore, poi stiamo generando una query a partire dai mapping e la stiamo eseguendo sul triplestore. Poi salviamo il risultato della query su csv. Poi carichiamo il CSV