CodeFerret

ShapeName_01.ttl

May 28th, 2020
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  2. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
  3. @prefix sh: <http://www.w3.org/ns/shacl#> .
  4. @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
  5. @prefix bdo: <http://purl.bdrc.io/ontology/core/> .
  6. @prefix bds: <http://purl.bdrc.io/ontology/shapes/core/> .
  7. @prefix bdr: <http://purl.bdrc.io/resource/> .
  8.  
  9. bds:PersonShape
  10. a sh:NodeShape ;
  11. rdfs:label "Person Shape"@en ;
  12. sh:property bds:PersonShape-personName ;
  13. sh:targetClass bdo:Person ;
  14. .
  15. bds:Pfx_rdf
  16. a sh:PrefixDeclaration ;
  17. sh:declare [
  18. sh:prefix "rdf" ;
  19. sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
  20. ] ;
  21. .
  22. bds:Pfx_rdfs
  23. a sh:PrefixDeclaration ;
  24. sh:declare [
  25. sh:prefix "rdfs" ;
  26. sh:namespace "http://www.w3.org/2000/01/rdf-schema#" ;
  27. ] ;
  28. .
  29. bds:Pfx_bdo
  30. a sh:PrefixDeclaration ;
  31. sh:declare [
  32. sh:prefix "bdo" ;
  33. sh:namespace "http://purl.bdrc.io/ontology/core/" ;
  34. ] ;
  35. .
  36. bds:CheckPersonNameClass
  37. a sh:NodeShape ;
  38. rdfs:label "Check PersonName Class Shape"@en ;
  39. sh:targetObjectsOf bdo:personName ;
  40. sh:message "focusNode must be subClassOf* bdo:PersonName" ;
  41. sh:sparql [
  42. a sh:SPARQLConstraint ;
  43. sh:prefixes bds:Pfx_rdf , bds:Pfx_rdfs , bds:Pfx_bdo ;
  44. sh:select """
  45. select distinct $this
  46. where {
  47. $this rdf:type ?type .
  48. filter not exists { ?type rdfs:subClassOf* bdo:PersonName . } .
  49. }
  50. """ ;
  51. ] ;
  52. .
  53. bds:PersonShape-personName
  54. a sh:PropertyShape ;
  55. sh:class bdo:PersonName ;
  56. sh:message "PersonName is not well-formed, wrong Class or missing rdfs:label"@en ;
  57. sh:minCount 1 ;
  58. sh:node bds:PersonNameShape ;
  59. sh:nodeKind sh:IRI ;
  60. sh:path bdo:personName ;
  61. .
  62. bds:PersonNameShape a sh:NodeShape ;
  63. sh:property bds:PersonNameShape-personNameLabel ;
  64. sh:targetClass bdo:PersonName ;
  65. .
  66. bds:PersonNameShape-personNameLabel
  67. a sh:PropertyShape ;
  68. sh:datatype rdf:langString ;
  69. sh:message ":PersonName must have exactly one rdfs:label"@en ;
  70. sh:maxCount 1 ;
  71. sh:minCount 1 ;
  72. sh:path rdfs:label ;
  73. .
Add Comment
Please, Sign In to add comment