SlideShare una empresa de Scribd logo
1 de 24
Making Topic Maps
Sparql
Agenda
• Rationale
• SPARQL
• Theory
• Some examples
TMSparql
• A set of conventions and a small pseudo-
ontology to enable a topic map to present
itself as a SPARQL end-point
Rationale
• Integration
• A Simple Query Language
SPARQL
• A query language based on graph pattern
matching with support for value testing.
• The result of a SPARQL query is a list of
the different combination of variable-to-
term mappings that match against the
queried graph
Basic Matching
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox WHERE
{
?x foaf:name ?name .
?x foaf:mbox ?mbox
}
Filtering
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX ns: <http://example.org/ns#>
SELECT ?title ?price WHERE
{
?x ns:price ?price .
FILTER (?price < 30.5)
?x dc:title ?title .
}
Optional Pattern Matching
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox WHERE
{
?x foaf:name ?name .
OPTIONAL { ?x foaf:mbox ?mbox }
}
Alternative Patterns
PREFIX dc10: <http://purl.org/dc/elements/1.0/>
PREFIX dc11: <http://purl.org/dc/elements/1.1/>
SELECT ?title WHERE
{
{ ?book dc10:title ?title } UNION { ?book
dc11:title ?title }
}
Goals
• Don’t get caught up in RDF <-> Topic Maps
conversion
• Make the result as intuitive and interoperable as
possible
– No extensions to the SPARQL syntax
– Limited use of “magic” identifiers
• Linked Data Query Interop
– Make it possible to fire the same queries at RDF-
based and Topic Maps-based SPARQL endpoints and
get equivalent results.
Resource Identifiers
• In RDF, every resource has a single URI
identifier.
• In Topic Maps topics in particular have
multiple identifiers.
• Solution:
– Any subject identifier can be used to refer to a
topic item.
– Any item identifier can be used to refer to a
topic map item
Basic Triple Patterns
• To make TMSparql intuitive and to make
SPARQL queries to Topic Maps equivalent
to RDF we introduce a number of basic
triple matching patterns.
• The intuitive nature of TMSparql comes
from being selective and restrictive about
how these patterns are defined.
Type-Instance Triple
• ?instance a ?type
• ?instance rdf:type ?type
– ?type identifies a topic item
– ?instance identifies a topic, association,
occurrence or role item that is an instance of
the topic identified by ?type
Examples
SELECT ?person {
?person a ont:person
}
Finds all instances of ont:person
SELECT ?type {
http://www.networkedplanet.com/ a ?type
}
Returns the topics that define the type(s) of the topic
with the subject or item identifier
http://www.networkedplanet.com.
Topic Property Triple
• ?topic ?type ?value
– ?topic bound to a topic item
– ?type bound to a topic item
– ?value bound to the value of an occurrence or
name of ?topic where the occurrence type is
defined by ?type
Examples
SELECT ?person, ?age {
?person a ont:person .
?person ont:age ?age
}
Finds all instances of ont:person that have
an ont:age occurrence and returns the
each matching person/age pair.
Examples
• The object part of the triple binds to a literal
value, so we can also make use of SPARQL
FILTER
SELECT ?person , ?age {
?person a ont:person .
?person ont:age ?age .
FILTER ( ?age >= 18 )
}
Find all people we can serve beer to
Related Topics Triple
• ?topic ?roleType ?relatedTopic
– Binds ?topic to any topic that plays a role of a type
other than the type bound to ?roleType in an
association
– Binds ?roleType to the type of role played by the
topic bound to ?relatedTopic
– Binds ?relatedTopic to any topic that plays a role
of the type bound to ?roleType
• Allows us to traverse an association using the
target role type as the predicate.
Example
SELECT ?person, ?company {
?person ont:employer ?company
}
Binds ?company to any topic that plays a
role of type ont:employer in an association
and binds ?person to the topic(s) that play
any other type of role in that association.
Aside: Mapping RDF Vocabularies
• Map RDF predicates that have a literal range to occurrence types.
• Map RDF predicates that have a resource range to role types (and
generate the association type and inverse role type).
E.g. If we have:
– foaf:name mapped to a name type and
– foaf:member mapped to a role type
Then the following query works against an RDF-based or TM-based
endpoint:
SELECT ?memberName, ?groupName {
?g foaf:member ?m .
?m foaf:name ?memberName .
?g foaf:name ?groupName
}
TMSparql Predicates
• The basic triple patterns introduced above provide
the ability to traverse from topic to topic and to
retrieve and filter on the properties of topics.
• For the occasions when a topic map practitioner
needs to get into more detail, we introduce a
number of predicates that perform different model
traversals.
• All TMSparql predicates use the namespace
http://www.networkedplanet.com/tmsparql
(mapped to tms: in the following examples)
TMSparql Predicates
• tms:reifier
– Traversal from a topic map item to its reifier.
• tms:topicProperty
– Traversal from a topic item to its name and occurrence items
• tms:value
– Traversal from a name or occurrence item to its value
• tms:role
– Traversal from an association item to its role items
• tms:player
– Traversal from a role item to the role player topic item
• tms:scope
– Traversal from a scoped topic map item to the topic items in its
scope.
Example
SELECT ?employmentAssoc, ?person, ?company,
?position {
?employmentAssoc a ont:worksFor .
?employmentAssoc tms:role ?r1 .
?r1 a ont:employee .
?r1 tms:player ?person .
?r2 a ont:employer .
?r2 tms:player ?company .
}
Finds all associations of type ont:worksFor with at least one role
of type ont:employee and one of type ont:employer and binds
the role players to ?person and ?company respectively.
Conclusion
• TMSparql is an implementation of the
SPARQL query language on top of the
TMDM.
• With careful mapping of ontologies, it is
possible to create a TMDM repository for
RDF data that responds to SPARQL queries
in the same way as a “native” RDF repository
would
• TMSparql makes it possible for TMDM
repositories to participate more fully in the
Linked Data web

Más contenido relacionado

La actualidad más candente

Information Extraction from the Web - Algorithms and Tools
Information Extraction from the Web - Algorithms and ToolsInformation Extraction from the Web - Algorithms and Tools
Information Extraction from the Web - Algorithms and ToolsBenjamin Habegger
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphsandyseaborne
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyMartin Odersky
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphsandyseaborne
 
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...Lucidworks
 
Exploiting Entity Linking in Queries For Entity Retrieval
Exploiting Entity Linking in Queries For Entity RetrievalExploiting Entity Linking in Queries For Entity Retrieval
Exploiting Entity Linking in Queries For Entity RetrievalFaegheh Hasibi
 
Twinkle: A SPARQL Query Tool
Twinkle: A SPARQL Query ToolTwinkle: A SPARQL Query Tool
Twinkle: A SPARQL Query ToolLeigh Dodds
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialAdonisDamian
 
Presentation of OpenNLP
Presentation of OpenNLPPresentation of OpenNLP
Presentation of OpenNLPRobert Viseur
 
SPARQL Query Verbalization for Explaining Semantic Search Engine Queries
SPARQL Query Verbalization for Explaining Semantic Search Engine QueriesSPARQL Query Verbalization for Explaining Semantic Search Engine Queries
SPARQL Query Verbalization for Explaining Semantic Search Engine QueriesBasil Ell
 

La actualidad más candente (14)

From DOT to Dotty
From DOT to DottyFrom DOT to Dotty
From DOT to Dotty
 
Information Extraction from the Web - Algorithms and Tools
Information Extraction from the Web - Algorithms and ToolsInformation Extraction from the Web - Algorithms and Tools
Information Extraction from the Web - Algorithms and Tools
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in Dotty
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...
An Introduction to NLP4L - Natural Language Processing Tool for Apache Lucene...
 
Exploiting Entity Linking in Queries For Entity Retrieval
Exploiting Entity Linking in Queries For Entity RetrievalExploiting Entity Linking in Queries For Entity Retrieval
Exploiting Entity Linking in Queries For Entity Retrieval
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
SPARQL Cheat Sheet
SPARQL Cheat SheetSPARQL Cheat Sheet
SPARQL Cheat Sheet
 
Twinkle: A SPARQL Query Tool
Twinkle: A SPARQL Query ToolTwinkle: A SPARQL Query Tool
Twinkle: A SPARQL Query Tool
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
 
Presentation of OpenNLP
Presentation of OpenNLPPresentation of OpenNLP
Presentation of OpenNLP
 
SPARQL Query Verbalization for Explaining Semantic Search Engine Queries
SPARQL Query Verbalization for Explaining Semantic Search Engine QueriesSPARQL Query Verbalization for Explaining Semantic Search Engine Queries
SPARQL Query Verbalization for Explaining Semantic Search Engine Queries
 

Similar a Making Topicmaps SPARQL

SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)Thomas Francart
 
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge BasesEvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge BasesSebastian Tramp
 
ontology.ppt
ontology.pptontology.ppt
ontology.pptPrerak10
 
First Steps in Semantic Data Modelling and Search & Analytics in the Cloud
First Steps in Semantic Data Modelling and Search & Analytics in the CloudFirst Steps in Semantic Data Modelling and Search & Analytics in the Cloud
First Steps in Semantic Data Modelling and Search & Analytics in the CloudOntotext
 
Semantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkSemantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkNamgee Lee
 
Introduction to Graphs with Neo4j
Introduction to Graphs with Neo4jIntroduction to Graphs with Neo4j
Introduction to Graphs with Neo4jNeo4j
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic WebJan Beeck
 
T3dallas typoscript
T3dallas typoscriptT3dallas typoscript
T3dallas typoscriptzdavis
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2Dimitris Kontokostas
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?LeeFeigenbaum
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentationChristian Morbidoni
 
Semantic web
Semantic webSemantic web
Semantic webtariq1352
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Re-using Media on the Web: Media fragment re-mixing and playout
Re-using Media on the Web: Media fragment re-mixing and playoutRe-using Media on the Web: Media fragment re-mixing and playout
Re-using Media on the Web: Media fragment re-mixing and playoutMediaMixerCommunity
 
20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetupRik Van Bruggen
 

Similar a Making Topicmaps SPARQL (20)

SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
 
Nikunau
NikunauNikunau
Nikunau
 
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge BasesEvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases
EvoPat - Pattern-Based Evolution and Refactoring of RDF Knowledge Bases
 
ontology.ppt
ontology.pptontology.ppt
ontology.ppt
 
First Steps in Semantic Data Modelling and Search & Analytics in the Cloud
First Steps in Semantic Data Modelling and Search & Analytics in the CloudFirst Steps in Semantic Data Modelling and Search & Analytics in the Cloud
First Steps in Semantic Data Modelling and Search & Analytics in the Cloud
 
Sparql
SparqlSparql
Sparql
 
Semantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynkSemantic web for ontology chapter4 bynk
Semantic web for ontology chapter4 bynk
 
Introduction to Graphs with Neo4j
Introduction to Graphs with Neo4jIntroduction to Graphs with Neo4j
Introduction to Graphs with Neo4j
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic Web
 
T3dallas typoscript
T3dallas typoscriptT3dallas typoscript
T3dallas typoscript
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
RDF and Java
RDF and JavaRDF and Java
RDF and Java
 
Jena Programming
Jena ProgrammingJena Programming
Jena Programming
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentation
 
Semantic web
Semantic webSemantic web
Semantic web
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Re-using Media on the Web: Media fragment re-mixing and playout
Re-using Media on the Web: Media fragment re-mixing and playoutRe-using Media on the Web: Media fragment re-mixing and playout
Re-using Media on the Web: Media fragment re-mixing and playout
 
20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup20141216 graph database prototyping ams meetup
20141216 graph database prototyping ams meetup
 

Último

IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 

Último (20)

IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 

Making Topicmaps SPARQL

  • 2. Agenda • Rationale • SPARQL • Theory • Some examples
  • 3. TMSparql • A set of conventions and a small pseudo- ontology to enable a topic map to present itself as a SPARQL end-point
  • 4. Rationale • Integration • A Simple Query Language
  • 5. SPARQL • A query language based on graph pattern matching with support for value testing. • The result of a SPARQL query is a list of the different combination of variable-to- term mappings that match against the queried graph
  • 6. Basic Matching PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x foaf:name ?name . ?x foaf:mbox ?mbox }
  • 7. Filtering PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ns: <http://example.org/ns#> SELECT ?title ?price WHERE { ?x ns:price ?price . FILTER (?price < 30.5) ?x dc:title ?title . }
  • 8. Optional Pattern Matching PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x foaf:name ?name . OPTIONAL { ?x foaf:mbox ?mbox } }
  • 9. Alternative Patterns PREFIX dc10: <http://purl.org/dc/elements/1.0/> PREFIX dc11: <http://purl.org/dc/elements/1.1/> SELECT ?title WHERE { { ?book dc10:title ?title } UNION { ?book dc11:title ?title } }
  • 10. Goals • Don’t get caught up in RDF <-> Topic Maps conversion • Make the result as intuitive and interoperable as possible – No extensions to the SPARQL syntax – Limited use of “magic” identifiers • Linked Data Query Interop – Make it possible to fire the same queries at RDF- based and Topic Maps-based SPARQL endpoints and get equivalent results.
  • 11. Resource Identifiers • In RDF, every resource has a single URI identifier. • In Topic Maps topics in particular have multiple identifiers. • Solution: – Any subject identifier can be used to refer to a topic item. – Any item identifier can be used to refer to a topic map item
  • 12. Basic Triple Patterns • To make TMSparql intuitive and to make SPARQL queries to Topic Maps equivalent to RDF we introduce a number of basic triple matching patterns. • The intuitive nature of TMSparql comes from being selective and restrictive about how these patterns are defined.
  • 13. Type-Instance Triple • ?instance a ?type • ?instance rdf:type ?type – ?type identifies a topic item – ?instance identifies a topic, association, occurrence or role item that is an instance of the topic identified by ?type
  • 14. Examples SELECT ?person { ?person a ont:person } Finds all instances of ont:person SELECT ?type { http://www.networkedplanet.com/ a ?type } Returns the topics that define the type(s) of the topic with the subject or item identifier http://www.networkedplanet.com.
  • 15. Topic Property Triple • ?topic ?type ?value – ?topic bound to a topic item – ?type bound to a topic item – ?value bound to the value of an occurrence or name of ?topic where the occurrence type is defined by ?type
  • 16. Examples SELECT ?person, ?age { ?person a ont:person . ?person ont:age ?age } Finds all instances of ont:person that have an ont:age occurrence and returns the each matching person/age pair.
  • 17. Examples • The object part of the triple binds to a literal value, so we can also make use of SPARQL FILTER SELECT ?person , ?age { ?person a ont:person . ?person ont:age ?age . FILTER ( ?age >= 18 ) } Find all people we can serve beer to
  • 18. Related Topics Triple • ?topic ?roleType ?relatedTopic – Binds ?topic to any topic that plays a role of a type other than the type bound to ?roleType in an association – Binds ?roleType to the type of role played by the topic bound to ?relatedTopic – Binds ?relatedTopic to any topic that plays a role of the type bound to ?roleType • Allows us to traverse an association using the target role type as the predicate.
  • 19. Example SELECT ?person, ?company { ?person ont:employer ?company } Binds ?company to any topic that plays a role of type ont:employer in an association and binds ?person to the topic(s) that play any other type of role in that association.
  • 20. Aside: Mapping RDF Vocabularies • Map RDF predicates that have a literal range to occurrence types. • Map RDF predicates that have a resource range to role types (and generate the association type and inverse role type). E.g. If we have: – foaf:name mapped to a name type and – foaf:member mapped to a role type Then the following query works against an RDF-based or TM-based endpoint: SELECT ?memberName, ?groupName { ?g foaf:member ?m . ?m foaf:name ?memberName . ?g foaf:name ?groupName }
  • 21. TMSparql Predicates • The basic triple patterns introduced above provide the ability to traverse from topic to topic and to retrieve and filter on the properties of topics. • For the occasions when a topic map practitioner needs to get into more detail, we introduce a number of predicates that perform different model traversals. • All TMSparql predicates use the namespace http://www.networkedplanet.com/tmsparql (mapped to tms: in the following examples)
  • 22. TMSparql Predicates • tms:reifier – Traversal from a topic map item to its reifier. • tms:topicProperty – Traversal from a topic item to its name and occurrence items • tms:value – Traversal from a name or occurrence item to its value • tms:role – Traversal from an association item to its role items • tms:player – Traversal from a role item to the role player topic item • tms:scope – Traversal from a scoped topic map item to the topic items in its scope.
  • 23. Example SELECT ?employmentAssoc, ?person, ?company, ?position { ?employmentAssoc a ont:worksFor . ?employmentAssoc tms:role ?r1 . ?r1 a ont:employee . ?r1 tms:player ?person . ?r2 a ont:employer . ?r2 tms:player ?company . } Finds all associations of type ont:worksFor with at least one role of type ont:employee and one of type ont:employer and binds the role players to ?person and ?company respectively.
  • 24. Conclusion • TMSparql is an implementation of the SPARQL query language on top of the TMDM. • With careful mapping of ontologies, it is possible to create a TMDM repository for RDF data that responds to SPARQL queries in the same way as a “native” RDF repository would • TMSparql makes it possible for TMDM repositories to participate more fully in the Linked Data web

Notas del editor

  1. Oxford-based software technology company developing products focussed on helping organisations to better manage the complex relationships between conceptual models such as business processes and domain knowledge and documents, data and other information that people use on a day-to-day basis. Developed out of working on the ISO standard for structured information exchange – Topic Maps.
  2. For the (typical) binary association case, or for associations that have only two distinct role types, this produces an intuitive result.