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
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
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
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 

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...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
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
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 

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