diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/CQ1.sparql b/documentation/user-guides/design-patterns/Design Pattern 1/CQ1.sparql new file mode 100644 index 0000000..034816e --- /dev/null +++ b/documentation/user-guides/design-patterns/Design Pattern 1/CQ1.sparql @@ -0,0 +1,12 @@ +PREFIX rdf: +PREFIX rdfs: +PREFIX cco: +PREFIX obo: +PREFIX owl: + +SELECT ?document ?document_field +WHERE { + ?document obo:BFO_0000178 ?document_field . #has continuant part + ?document a cco:ont00001298 . #document + ?document_field a cco:ont00001243 . #document field +} diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/CQ2.sparql b/documentation/user-guides/design-patterns/Design Pattern 1/CQ2.sparql new file mode 100644 index 0000000..09b741e --- /dev/null +++ b/documentation/user-guides/design-patterns/Design Pattern 1/CQ2.sparql @@ -0,0 +1,11 @@ +PREFIX rdf: +PREFIX cco: +PREFIX obo: + +SELECT ?document (COUNT(?field) AS ?fieldCount) +WHERE { + ?document rdf:type cco:ont00001298 . + ?document obo:BFO_0000178 ?field . + ?field rdf:type cco:ont00001243 . +} +GROUP BY ?document diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/CQ3.sparql b/documentation/user-guides/design-patterns/Design Pattern 1/CQ3.sparql new file mode 100644 index 0000000..f558189 --- /dev/null +++ b/documentation/user-guides/design-patterns/Design Pattern 1/CQ3.sparql @@ -0,0 +1,13 @@ +PREFIX rdf: +PREFIX rdfs: +PREFIX cco: +PREFIX obo: +PREFIX owl: + +SELECT ?data ?document_field ?document +WHERE { + ?document_field a cco:ont00001243 . # document field + ?document_field cco:ont00001765 ?data . # has text value + ?document obo:BFO:0000178 ?document_field . # has continuant part +} + diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Documentation.md b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Documentation.md new file mode 100644 index 0000000..7a8f929 --- /dev/null +++ b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Documentation.md @@ -0,0 +1,19 @@ +# Pattern Name +Document Field + +## Compentency Questions +1) What document is this document field a part of? + +2) How many document fields are in the document? + +3) What is the string of text associated with this document field? + +## Intent +Showing the document field is a part of a document. + +Comes in hand when representing documents with multiple fields, so that we can link more than one ICE to the same IBE. + +## Structure +The document has as parts two document fields. One of them carries one ICE, specifically a designative Name. + +Despite using names as an example, this pattern can be used with any other ICE. diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Mermaid b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Mermaid new file mode 100644 index 0000000..710692c --- /dev/null +++ b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Mermaid @@ -0,0 +1,50 @@ +flowchart BT + E@{ label: "Document Field 2
" } -. has text value
ont00001765 .-> n1["Mary"] + n5["Document"] -- rdf:type --> n6@{ label: "Document
ont00001298

" } + n5 -- has continuant part
BFO:0000178 --> n7@{ label: "Document Field 1
" } + n7 -- rdf:type --> n8@{ label: "Document Field
ont00001243

" } + n9@{ label: "Agent 1" } -- rdf:type --> n10@{ label: "Agent
ont00001017

" } + n7 -. has text value
ont00001765 .-> n11["John"] + n12@{ label: "Designative Name 1" } -- rdf:type --> n13@{ label: "Designative Name
ont00000003
" } + n12 -- designates
ont00001916 --> n9 + n7 -- is carrier of
BFO_0000101 --> n12 + n5 -- has continuant part
BFO:0000178 --> E + E -- rdf:type --> n8 + + subgraph Legend + AA{Individual} + BB[Class] + CC[data] + AA --> |relation| CC + classDef yellow fill:#ffe680 + classDef purple fill:#dbc9ef + classDef white fill:#ffffff + class BB yellow + class AA purple + class CC white + end + + E@{ shape: diamond} + n5@{ shape: diam} + n6@{ shape: rect} + n7@{ shape: diam} + n8@{ shape: rect} + n9@{ shape: diam} + n10@{ shape: rect} + n11@{ shape: rect} + n12@{ shape: diam} + n13@{ shape: rect} + E:::purple + n1:::white + n5:::purple + n6:::yellow + n7:::purple + n8:::yellow + n9:::purple + n10:::yellow + n11:::white + n12:::purple + n13:::yellow + classDef yellow fill:#ffe680 + classDef purple fill:#dbc9ef + classDef white fill:#FFFFFF diff --git a/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_V6.png b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_V6.png new file mode 100644 index 0000000..d0cfa65 Binary files /dev/null and b/documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_V6.png differ diff --git a/documentation/user-guides/design-patterns/README.md b/documentation/user-guides/design-patterns/README.md index 42c5cf9..83baf4a 100644 --- a/documentation/user-guides/design-patterns/README.md +++ b/documentation/user-guides/design-patterns/README.md @@ -3,3 +3,10 @@ This folder contains common CCO design patterns. Each entry includes a mermaid graph, a visualization of that graph, a description of competency questions answered, and a sparql query to support the competency questions. Users are encouraged to reuse these design patterns in their knowledge graphs to speed up data mapping and querying while ensuring greater consistency and interoperability across knowledge graphs. + +## Folder Directory + +| Folder Name | Description | +|------------------|--------------------------------------------| +| Design Pattern 1 | Document Field | +