Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX cco: <https://www.commoncoreontologies.org/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX owl: <http://www.w3.org/2002/07/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
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider the following style, which make the query more readable:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cco: <https://www.commoncoreontologies.org/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX material_copy_of_a_document: <https://www.commoncoreontologies.org/ont00001298>
PREFIX has_continuant_part: <http://purl.obolibrary.org/obo/BFO_0000178>
PREFIX material_copy_of_a_document_field: <https://www.commoncoreontologies.org/ont00001243>

SELECT ?document (COUNT(?field) AS ?fieldCount)
WHERE {
  ?document rdf:type material_copy_of_a_document: .
  ?document has_continuant_part: ?field .
  ?field rdf:type material_copy_of_a_document_field:.
}
GROUP BY ?document

That said, I don't know why you are using IBEs v ICEs in this pattern.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cco: <https://www.commoncoreontologies.org/>
PREFIX obo: <http://purl.obolibrary.org/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