SlideShare a Scribd company logo
1 of 18
SPIN and Shapes 
RDF Data Shapes WG F2F, Nov 2014 
Holger Knublauch 
TopQuadrant, Inc.
SPIN History and Status 
• Created at TopQuadrant 2008 
• Addresses requirements from customer projects 
• Supported by TopBraid tools (incl. TBC Free) 
• Open source: http://topbraid.org/spin/api/ 
• Partial support by 3rd party database vendors 
• W3C Member Submission 2011 
• Many SPIN-based systems are in production
Constraints in SPARQL (ASK) 
ss:Square 
spin:constraint [ 
a sp:Ask ; 
sp:text """ 
# Width and height must be equal 
ASK WHERE { 
?this ss:width ?width . 
?this ss:height ?height . 
FILTER (?width != ?height) . 
} 
""" 
]
Constraints in SPARQL (CONSTRUCT) 
ss:Square 
spin:constraint [ 
rdf:type sp:Construct ; 
sp:text """ 
# Width and height must be equal 
CONSTRUCT { 
_:cv a spin:ConstraintViolation ; 
spin:violationRoot ?this ; 
spin:violationPath ss:height ; 
rdfs:label "Width and height must be equal" 
} 
WHERE { 
?this ss:width ?width . 
?this ss:height ?height . 
FILTER (?width != ?height) . 
} 
""" 
]
Possible Syntactic Sugar 
Idea from Simister, Brickley: 
http://www.w3.org/2001/sw/wiki/images/0/00/SimpleApplication- 
SpecificConstraintsforRDFModels.pdf 
ss:Square 
spin:constraint [ 
a spin:Ask ; 
spin:context ss:height ; 
spin:message "Width and height must be equal" ; 
spin:sparql """ 
ASK WHERE { 
?this ss:width ?width . 
?this ss:height ?height . 
FILTER (?width != ?height) . 
} 
""" 
] 
(The current SPIN is just a starting point, it’s an open RDF vocabulary)
Alternative to source code editing 
Syntax checking 
Auto-complete 
Keyword highlighting 
Results preview …
Positive values constraint in SPARQL 
ss:Rectangle 
spin:constraint [ 
a sp:Construct ; 
sp:text """ 
# The value of ss:width must be > 0 
CONSTRUCT { 
_:cv a spin:ConstraintViolation ; 
spin:violationRoot ?this ; 
spin:violationPath ss:width ; 
rdfs:label "The width of a rectangle must be > 0" 
} 
WHERE { 
?this ss:width ?width . 
FILTER (?width <= 0) . 
} 
""" 
] 
… the same would have to be repeated for ss:height
Generalizing the constraint 
ss:Rectangle 
spin:constraint [ 
a sp:Construct ; 
sp:text """ 
# The value of ss:width must be > 0 
CONSTRUCT { 
_:cv a spin:ConstraintViolation ; 
spin:violationRoot ?this ; 
spin:violationPath ss:width ; 
rdfs:label "The width of a rectangle must be > 0" 
} 
WHERE { 
?this ss:width ?width . 
FILTER (?width <= 0) . 
} 
""" 
] 
ss:width could be 
replaced with any 
property, e.g. 
ss:height
Introducing a SPIN Template 
ss:PositivePropertyValueConstraint a spin:ConstructTemplate ; 
spin:constraint [ a spl:Argument 
spl:predicate arg:property ; 
spl:valueType rdf:Property ; 
rdfs:comment "The property to constrain (e.g. ss:width)" 
] ; 
spin:body [ a sp:Construct ; 
sp:text """ 
CONSTRUCT { 
_:cv a spin:ConstraintViolation ; 
spin:violationRoot ?this ; 
spin:violationPath ?property ; 
rdfs:label "Positive value expected" 
} 
WHERE { 
?this ?property ?value . 
FILTER (?value <= 0) . 
} 
""" 
] ;
Using a SPIN Template 
ss:Rectangle 
spin:constraint [ 
a ss:PositivePropertyValueConstraint ; 
arg:property ss:height ; 
] ; 
spin:constraint [ 
a ss:PositivePropertyValueConstraint ; 
arg:property ss:width ; 
] . 
Such templates can be published in libraries, for example for Shapes.
Example Tool Support (1)
Example Tool Support (2)
Example Tool Support (3)
SPIN Templates 
• Can define new modeling languages 
• Template definitions are linked data (URI etc) 
• Encapsulate/hide SPARQL queries 
• Yet executable on standard RDF databases 
• But processors do not have to use SPARQL only 
• Combine maximum flexibility & expressivity 
with a structural user-friendly syntax.
SPIN Functions
SPIN Libraries 
• SPIN templates, functions and constraints can 
be published on the semantic web 
– Example: http://semwebquality.org 
• Libraries define “Profiles” 
• Web provides a natural evolution mechanism 
• This WG would define a standard library
Possible Shapes Architecture
OSLC Bug Example 
oslc_cm:ChangeRequest 
a rdfs:Class ; 
rdfs:label "Change request" ; 
oslc:property [ 
ChangeRequest 
title : string [1..1] 
status : status-values [0..1] 
a oslc:Property ; 
oslc:propertyDefinition dcterms:title ; 
oslc:occurs oslc:Exactly-one 
] ; 
oslc:property [ 
a oslc:Property ; 
oslc:propertyDefinition oslc_cm:status ; 
oslc:allowedValues oslc_cm:status-values ; 
oslc:occurs oslc:Zero-or-one 
] . 
This is a valid SPIN document

More Related Content

What's hot

Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic searchmarkstory
 
Solid pods and the future of the spatial web
Solid pods and the future of the spatial webSolid pods and the future of the spatial web
Solid pods and the future of the spatial webKurt Cagle
 
Elastic Search
Elastic SearchElastic Search
Elastic SearchNavule Rao
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Karel Minarik
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Karel Minarik
 
Analytics and Graph Traversal with Solr - Yonik Seeley, Cloudera
Analytics and Graph Traversal with Solr - Yonik Seeley, ClouderaAnalytics and Graph Traversal with Solr - Yonik Seeley, Cloudera
Analytics and Graph Traversal with Solr - Yonik Seeley, ClouderaLucidworks
 
Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Karel Minarik
 
Beyond shuffling - Strata London 2016
Beyond shuffling - Strata London 2016Beyond shuffling - Strata London 2016
Beyond shuffling - Strata London 2016Holden Karau
 
Aem sling resolution
Aem sling resolutionAem sling resolution
Aem sling resolutionGaurav Tiwari
 
Elastic search Walkthrough
Elastic search WalkthroughElastic search Walkthrough
Elastic search WalkthroughSuhel Meman
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
A Survey of Elasticsearch Usage
A Survey of Elasticsearch UsageA Survey of Elasticsearch Usage
A Survey of Elasticsearch UsageGreg Brown
 
Finding knowledge, data and answers on the Semantic Web
Finding knowledge, data and answers on the Semantic WebFinding knowledge, data and answers on the Semantic Web
Finding knowledge, data and answers on the Semantic Webebiquity
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 MinutesKarel Minarik
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.Jurriaan Persyn
 
Using Sphinx for Search in PHP
Using Sphinx for Search in PHPUsing Sphinx for Search in PHP
Using Sphinx for Search in PHPMike Lively
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchJason Austin
 
How to scale relational (OLTP) databases. Think: Sharding @C16LV
How to scale relational (OLTP) databases. Think: Sharding @C16LVHow to scale relational (OLTP) databases. Think: Sharding @C16LV
How to scale relational (OLTP) databases. Think: Sharding @C16LVMaxym Kharchenko
 

What's hot (20)

Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph Databases
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic search
 
Solid pods and the future of the spatial web
Solid pods and the future of the spatial webSolid pods and the future of the spatial web
Solid pods and the future of the spatial web
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)
 
Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]Elasticsearch And Ruby [RuPy2012]
Elasticsearch And Ruby [RuPy2012]
 
Analytics and Graph Traversal with Solr - Yonik Seeley, Cloudera
Analytics and Graph Traversal with Solr - Yonik Seeley, ClouderaAnalytics and Graph Traversal with Solr - Yonik Seeley, Cloudera
Analytics and Graph Traversal with Solr - Yonik Seeley, Cloudera
 
Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)Elasticsearch (Rubyshift 2013)
Elasticsearch (Rubyshift 2013)
 
Beyond shuffling - Strata London 2016
Beyond shuffling - Strata London 2016Beyond shuffling - Strata London 2016
Beyond shuffling - Strata London 2016
 
Aem sling resolution
Aem sling resolutionAem sling resolution
Aem sling resolution
 
Elastic search Walkthrough
Elastic search WalkthroughElastic search Walkthrough
Elastic search Walkthrough
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
A Survey of Elasticsearch Usage
A Survey of Elasticsearch UsageA Survey of Elasticsearch Usage
A Survey of Elasticsearch Usage
 
Finding knowledge, data and answers on the Semantic Web
Finding knowledge, data and answers on the Semantic WebFinding knowledge, data and answers on the Semantic Web
Finding knowledge, data and answers on the Semantic Web
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
Using Sphinx for Search in PHP
Using Sphinx for Search in PHPUsing Sphinx for Search in PHP
Using Sphinx for Search in PHP
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
How to scale relational (OLTP) databases. Think: Sharding @C16LV
How to scale relational (OLTP) databases. Think: Sharding @C16LVHow to scale relational (OLTP) databases. Think: Sharding @C16LV
How to scale relational (OLTP) databases. Think: Sharding @C16LV
 

Similar to SPIN and Shapes

SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudRichard Cyganiak
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageNeo4j
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineDaniel N
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic webMarakana Inc.
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherEdward Wilde
 
Data translation with SPARQL 1.1
Data translation with SPARQL 1.1Data translation with SPARQL 1.1
Data translation with SPARQL 1.1andreas_schultz
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)Rajat Pratap Singh
 
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...Simeon Warner
 
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure ProvisioningRik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure ProvisioningWinOps Conf
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...Christian Tzolov
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and SparkLucidworks
 
The Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago MolaThe Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago MolaSpark Summit
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentationChristian Morbidoni
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 

Similar to SPIN and Shapes (20)

SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data Mud
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely together
 
Linked services
Linked servicesLinked services
Linked services
 
All about elasticsearch language clients
All about elasticsearch language clientsAll about elasticsearch language clients
All about elasticsearch language clients
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Data translation with SPARQL 1.1
Data translation with SPARQL 1.1Data translation with SPARQL 1.1
Data translation with SPARQL 1.1
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
 
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...
From Open Annotations to W3C Web Annotations (and the impact on IIIF Present...
 
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure ProvisioningRik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and Spark
 
Apache HAWQ Architecture
Apache HAWQ ArchitectureApache HAWQ Architecture
Apache HAWQ Architecture
 
The Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago MolaThe Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago Mola
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentation
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

SPIN and Shapes

  • 1. SPIN and Shapes RDF Data Shapes WG F2F, Nov 2014 Holger Knublauch TopQuadrant, Inc.
  • 2. SPIN History and Status • Created at TopQuadrant 2008 • Addresses requirements from customer projects • Supported by TopBraid tools (incl. TBC Free) • Open source: http://topbraid.org/spin/api/ • Partial support by 3rd party database vendors • W3C Member Submission 2011 • Many SPIN-based systems are in production
  • 3. Constraints in SPARQL (ASK) ss:Square spin:constraint [ a sp:Ask ; sp:text """ # Width and height must be equal ASK WHERE { ?this ss:width ?width . ?this ss:height ?height . FILTER (?width != ?height) . } """ ]
  • 4. Constraints in SPARQL (CONSTRUCT) ss:Square spin:constraint [ rdf:type sp:Construct ; sp:text """ # Width and height must be equal CONSTRUCT { _:cv a spin:ConstraintViolation ; spin:violationRoot ?this ; spin:violationPath ss:height ; rdfs:label "Width and height must be equal" } WHERE { ?this ss:width ?width . ?this ss:height ?height . FILTER (?width != ?height) . } """ ]
  • 5. Possible Syntactic Sugar Idea from Simister, Brickley: http://www.w3.org/2001/sw/wiki/images/0/00/SimpleApplication- SpecificConstraintsforRDFModels.pdf ss:Square spin:constraint [ a spin:Ask ; spin:context ss:height ; spin:message "Width and height must be equal" ; spin:sparql """ ASK WHERE { ?this ss:width ?width . ?this ss:height ?height . FILTER (?width != ?height) . } """ ] (The current SPIN is just a starting point, it’s an open RDF vocabulary)
  • 6. Alternative to source code editing Syntax checking Auto-complete Keyword highlighting Results preview …
  • 7. Positive values constraint in SPARQL ss:Rectangle spin:constraint [ a sp:Construct ; sp:text """ # The value of ss:width must be > 0 CONSTRUCT { _:cv a spin:ConstraintViolation ; spin:violationRoot ?this ; spin:violationPath ss:width ; rdfs:label "The width of a rectangle must be > 0" } WHERE { ?this ss:width ?width . FILTER (?width <= 0) . } """ ] … the same would have to be repeated for ss:height
  • 8. Generalizing the constraint ss:Rectangle spin:constraint [ a sp:Construct ; sp:text """ # The value of ss:width must be > 0 CONSTRUCT { _:cv a spin:ConstraintViolation ; spin:violationRoot ?this ; spin:violationPath ss:width ; rdfs:label "The width of a rectangle must be > 0" } WHERE { ?this ss:width ?width . FILTER (?width <= 0) . } """ ] ss:width could be replaced with any property, e.g. ss:height
  • 9. Introducing a SPIN Template ss:PositivePropertyValueConstraint a spin:ConstructTemplate ; spin:constraint [ a spl:Argument spl:predicate arg:property ; spl:valueType rdf:Property ; rdfs:comment "The property to constrain (e.g. ss:width)" ] ; spin:body [ a sp:Construct ; sp:text """ CONSTRUCT { _:cv a spin:ConstraintViolation ; spin:violationRoot ?this ; spin:violationPath ?property ; rdfs:label "Positive value expected" } WHERE { ?this ?property ?value . FILTER (?value <= 0) . } """ ] ;
  • 10. Using a SPIN Template ss:Rectangle spin:constraint [ a ss:PositivePropertyValueConstraint ; arg:property ss:height ; ] ; spin:constraint [ a ss:PositivePropertyValueConstraint ; arg:property ss:width ; ] . Such templates can be published in libraries, for example for Shapes.
  • 14. SPIN Templates • Can define new modeling languages • Template definitions are linked data (URI etc) • Encapsulate/hide SPARQL queries • Yet executable on standard RDF databases • But processors do not have to use SPARQL only • Combine maximum flexibility & expressivity with a structural user-friendly syntax.
  • 16. SPIN Libraries • SPIN templates, functions and constraints can be published on the semantic web – Example: http://semwebquality.org • Libraries define “Profiles” • Web provides a natural evolution mechanism • This WG would define a standard library
  • 18. OSLC Bug Example oslc_cm:ChangeRequest a rdfs:Class ; rdfs:label "Change request" ; oslc:property [ ChangeRequest title : string [1..1] status : status-values [0..1] a oslc:Property ; oslc:propertyDefinition dcterms:title ; oslc:occurs oslc:Exactly-one ] ; oslc:property [ a oslc:Property ; oslc:propertyDefinition oslc_cm:status ; oslc:allowedValues oslc_cm:status-values ; oslc:occurs oslc:Zero-or-one ] . This is a valid SPIN document