Skip to content

SHACL with FIBO (Version: NEO4j-4.3.4)- Not Validating with Graph_Config set to 'MAP' as Prefix is not being resolved #237

Description

@harbour-git

Current State of Graph:

  1. FIBO ontology loaded.
  2. Mappings & Namespaces loaded.
  3. RDF data imported and linked with the ontology.

Graph_Config:
1 | "handleVocabUris" | "MAP"
2 | "handleMultival" | "OVERWRITE"
3 | "handleRDFTypes" | "LABELS_AND_NODES"
4 | "keepLangTag" | false
5 | "keepCustomDataTypes" | false
6 | "applyNeo4jNaming" | false
7 | "baseSchemaNamespace" | "neo4j://graph.schema#"
8 | "baseSchemaPrefix" | "n4sch"
9 | "classLabel" | "Class"
10 | "subClassOfRel" | "SCO"
11 | "dataTypePropertyLabel" | "Property"
12 | "objectPropertyLabel" | "Relationship"
13 | "subPropertyOfRel" | "SPO"
14 | "domainRel" | "DOMAIN"
15 | "rangeRel" | "RANGE"

SHACL Validation Steps:

  1. Create shape constraints to validate the existing graph.

###########################################
@Prefix fibo-fro-combined-fob: http://www.semanticweb.org/combined/fiben_object_properties/ .
@Prefix fibo-fro-combined: http://www.semanticweb.org/combined/ .
@Prefix fibo-sec-sec-lst: https://spec.edmcouncil.org/fibo/ontology/SEC/Securities/SecuritiesListings/ .
@Prefix fibo-fnd-acc-cur: https://spec.edmcouncil.org/fibo/ontology/FND/Accounting/CurrencyAmount/ .
@Prefix sh: http://www.w3.org/ns/shacl# .

fibo-fro-combined:ListedSecurityShape a sh:NodeShape;
sh:targetClass fibo-sec-sec-lst:ListedSecurity;
sh:property[
sh:path fibo-fro-combined-fob:HASLASTTRADEDVALUE;
sh:minCount 1;
sh:class fibo-fnd-acc-cur:MonetaryAmount;
].

fibo-fro-combined:MonetaryamountShapewrong a sh:NodeShape;
sh:targetClass fibo-fnd-acc-cur:Monetaryamount;
sh:property[
sh:path fibo-fnd-acc-cur:hasamount;
sh:minInclusive 0;
].

##########################################

Output:

target propertyOrRelationshipPath param value
1 "fibo-fnd-acc-cur__Monetaryamount" "fibo-fnd-acc-cur__hasamount" "sh:minInclusive"
2 "fibo-sec-sec-lst__ListedSecurity" "fibo-fro-combined-fob__HASLASTTRADEDVALUE" "sh:class"
3 "fibo-sec-sec-lst__ListedSecurity" "fibo-fro-combined-fob__HASLASTTRADEDVALUE" "sh:minCount"

Observations:

  1. We observed that targets are not properly mapped/linked to the respective classes, properties, relations, etc in the ontology.
  2. When we run the Shacl Validation (call n10s.validation.shacl.validate() yield focusNode, nodeType,propertyShape,offendingValue,resultPath,severity), there is no validation is happening. (Ideal scenario is to validate if the last traded value of a stock is greater than zero. We have infused few cases in data to check the violation.)

Regards,
Team QUIPU

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions