Skip to content

Instantly share code, notes, and snippets.

View philbarker's full-sized avatar

Phil Barker philbarker

View GitHub Profile
@philbarker
philbarker / vocab-def-shacl.ttl
Created May 22, 2024 10:28
SHACL for very basic validation of RDF/S property definitions
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sdo: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
<PropertyDefinitionShape> a sh:NodeShape ;
sh:name "Property Definition Shape"@en ;
sh:description "Every RDFS Property must have a label and should have a domain. Descriptions are recommended";
sh:targetClass rdf:Property ;
@philbarker
philbarker / dentalAssistingCertL1.json
Last active January 24, 2024 11:23
Code for Dental Assisting Certificate (Technical Level 1) in CTDL handbook
{
"@context": {
"ceterms": "https://purl.org/ctdl/terms/",
"ceasn": "https://purl.org/ctdlasn/terms/",
"qdata": "https://credreg.net/qdata/terms/",
"schema": "https://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"res": "http://example.org/resources/",
@philbarker
philbarker / gist:b726f7cfeba1bafe8c7060dbea876d2f
Created November 17, 2023 11:04
SHACL file to define the schema for CTDL vocabulary definition files.
# SHACL file to define the schema for CTDL vocabulary definition files.
# Phil Barker, phil.barker@pjjk.co.uk
@base <https://purl.org/ctdl/constraints/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sdo: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@philbarker
philbarker / exMapping.ttl
Last active December 15, 2021 18:01
First cut at example DESM mapping & sparql query to pull out pairs of matching terms
@prefix : <http://example.local/> . # the "home" for this mapping
@prefix spine: <http://example.local/spine/> .
@prefix pred: <http://example.local/concepts/mappingPredicates#> .
@prefix abcl: <http://example.local/concepts/abstractClasses#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix desm: <http://desm.local/> . # to do: get real URI
@philbarker
philbarker / acme-job-abbrev.json
Last active May 5, 2021 13:47
Description of a job offered by an organization, requiring a license
{
"@context": {
"@version": 1.1,
"@import": "https://credreg.net/ctdl/schema/context/json",
"res": "http://example.org/resources/"
},
"@graph": [
{
"@id": "res:ce-df180ff8-48fb-4a2b-8781-b812f901ae23",
"@type": "ceterms:Job",
@philbarker
philbarker / acme-job.json
Last active May 5, 2021 11:51
Job description example
{
"@context": {
"@version": 1.1,
"@import": "https://credreg.net/ctdl/schema/context/json",
"res": "http://example.org/resources/"
},
"@graph": [
{
"@id": "res:Job_100-1234",
"@type": "ceterms:Job",
@philbarker
philbarker / nice-rsk.json
Last active May 5, 2021 13:17
Example of an occupation - workrole - task - competency described in CTDL; based on NICE Cyber Security framework.
{
"@context": {
"@version": 1.1,
"@import": "https://credreg.net/ctdl/schema/context/json",
"res": "http://example.org/resources/"
},
"@graph": [
{
"@id": "res:ce-ef0dc515-9d18-446a-ae77-3dc7797bc0de",
"@type": "ceterms:Occupation",
@philbarker
philbarker / navy_maintence_task_abbr.json
Last active May 5, 2021 13:23
Example of describing task in CTDL.
{
"@context": {
"@version": 1.1,
"@import": "https://credreg.net/ctdl/schema/context/json",
"res": "http://example.org/resources/"
},
"@graph": [
{
"@id": "res:ce-ef0dc515-1234-446a-ae77-9ec83f3aa1ef",
"@type": "skos:ConceptScheme",
@prefix dct: <http://purl.org/dc/terms/> .
@prefix desm: <http://desm.org/ns/> .
@prefix ceds: <http://desm.org/ns/ceds/> .
@prefix credReg: <http://desm.org/ns/credReg/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://desm.org/TermMapping/635cac5803e6> a desm:AbstractClassMapping ;
@philbarker
philbarker / ap.csv
Created May 19, 2020 14:52
Application Profile in csv and ShEx and a conformant instance
ID URI Label Type Value Space Comment
sdo: http://schema.org/ schema.org
foaf: http://xmlns.com/foaf/ FOAF
wd: http://www.wikidata.org/entity/ Wikidata Entities
wdt: http://www.wikidata.org/prop/direct/ Wikidata Properties
xsd: http://www.w3.org/2001/XMLSchema# XML Schema
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# RDF
@book Book
rdf:type instance of URI sdo:Book must be schema.org/Book