SlideShare a Scribd company logo
CycQL:A SPARQL
Adapter for OpenCyc
Steve Battle
@stevebattle
stevebattle@me.com
http://www.stevebattle.me
http://code.google.com/p/gloze/
Sunday, 26 May 13
OpenCyc 4.0
• Cyc was one of the first
Artificial Intelligence
systems to develop an
ontological approach to
organizing knowledge.
• OpenCyc 4.0, released in
June 2012, includes the
full Cyc ontology.
• Java API.
Sunday, 26 May 13
CycL
• A declarative language based on classical first-order logic.
• Includes Atomic and Non-AtomicTerms (NATs).
(#$orbits #$PlanetPluto #$TheSun)
(#$isa #$PlanetPluto #$DwarfPlanet)
(#$orbitalPeriod #$PlanetPluto (#$DaysDuration 90739))
(#$isa #$Charon-MoonOfPluto (#$MoonFn #$PlanetPluto))
(#$and
(#$isa ?PLANET #$DwarfPlanet)
(#$orbits ?PLANET #$TheSun)
)
Sunday, 26 May 13
RDF(CycL)
• Set the base URI base and prepend to Atomic terms.
e.g. to <<http://sw.opencyc.org/2012/05/10/concept/en/>
• Transpose the order of the terms to give the typical subject, predicate, object.
@base <http://sw.opencyc.org/2012/05/10/concept/en/> .
<PlanetPluto> <orbits> <TheSun> .
<PlanetPluto a <DwarfPlanet> .
<Charon-MoonOfPluto> <orbits> <PlanetPluto> .
<PlanetPluto> <orbitalPeriod> "90739"^^<DaysDuration> .
<PlanetPluto> <MoonFn> _:MoonOfPluto .
<Charon-MoonOfPluto> a _:MoonOfPluto .
Sunday, 26 May 13
SPARQL(RDF(CycL))
PREFIX : <>
SELECT ?planet ?moon
WHERE {
?planet a :DwarfPlanet ;
:orbits :TheSun
?moon :orbits ?planet .
}
----------------------------------------
| planet | moon |
========================================
| :PlanetPluto | :Charon-MoonOfPluto |
| :PlanetPluto | :Nix-MoonOfPluto |
| :PlanetPluto | :Hydra-MoonOfPluto |
| :PlanetPluto | :Vulcan-MoonOfPluto |
| :PlanetPluto | :Cerberus-MoonOfPluto |
----------------------------------------
(#$and
(#$isa ?PLANET #$DwarfPlanet)
(#$orbits ?PLANET #$TheSun)
(#$orbits ?MOON ?PLANET)
)
Full-query compilation issues:
• OPTIONAL left-join
• ORDER BY clause
• Named GRAPH clause
Sunday, 26 May 13
Microtheories
• Cyc’s knowledge-base is divided into microtheories.
• Microtheories are hierarchically organized.
CurrentWorldDataCollectorMt-NonHomocentric
UniverseDataMt
(#$orbits #$PlanetPluto #$TheSun)
(#$orbits #$PlanetEarth #$TheSun)
(#$isa #$PlanetPluto #$DwarfPlanet)
SELECT * FROM :CurrentWorldDataCollectorMt-NonHomocentric
FROM NAMED :UniverseDataMt
WHERE {
! GRAPH :UniverseDataMt {
! ! ?planet a :Planet ; :orbits :TheSun
! }
! FILTER (NOT EXISTS { ?planet a :DwarfPlanet })
}
Sunday, 26 May 13
Compilation Levels
PREFIX : <>
SELECT ?planet ?orbital_period
FROM :CurrentWorldDataCollectorMt-NonHomocentric
WHERE {
?planet a :Planet ;
:orbits :TheSun ;
:orbitalPeriod ?orbital_period
FILTER (NOT EXISTS {
?planet a :DwarfPlanet
})
}
0
20
40
60
80
triple/quad bgp operator
Cyc requests
Sunday, 26 May 13
CycL Functions
• CycL defines functions expressed as NATs.
e.g. #$ExponentFn, #$QuotientFn
• This expression defines Kepler’s 3rd law,
the relationship between the orbital radius in AUs,
and its orbital period, P:
(#$evaluate ?AU (#$ExponentFn (#$QuotientFn ?P 365) (#$QuotientFn 2 3)))
• Expressed in SPARQL using ARQ’s LET clause:
PREFIX cyc: <http://www.opencyc.org#>
PREFIX nat: <java:org.opencyc.sparql.function.nat.>
PREFIX : <>
SELECT ?planet ?AU FROM :UniverseDataMt
WHERE {
?planet a :Planet ;
:orbits :TheSun ; :orbitalPeriod ?p
LET (?AU :=
cyc:ExponentFn(cyc:QuotientFn(nat:Double(?p),365), cyc:QuotientFn(2,3)))
}
ORDER BY ?AU
Sunday, 26 May 13
CycL Rules
• The real purpose of CycQL is to provide access to
Cyc inference from SPARQL.
• Define a CycL rule that computes the orbital radius:
(#$implies
(#$and
(#$orbitalPeriod ?BODY (#$DaysDuration ?P))
(#$evaluate ?AU
(#$ExponentFn (#$QuotientFn ?P 365)
(#$QuotientFn 2 3))))
(#$orbitalRadius ?BODY (#$AstronomicalUnits ?AU))
)
Sunday, 26 May 13
Magic Predicates
PREFIX nat: <java:org.opencyc.sparql.function.nat.>
PREFIX : <>
SELECT * FROM :UniverseDataMt
WHERE {
?planet a :Planet ;
:orbits :TheSun ;
:orbitalRadius ?AU
FILTER (0.725 < nat:Double(?AU)
&& nat:Double(?AU) < 3.0)
}
ORDER BY nat:Double(?AU)
---------------------------------------------------
| planet | AU |
===================================================
| :PlanetEarth | "1.0"^^xsd:double |
| :PlanetMars | "1.5244361831950344"^^xsd:double |
---------------------------------------------------
• The Goldilock’s Zone lies between 0.725 and 3 AUs.
When Cyc searches for
#$orbitalRadius backward-
chaining rule evaluation is
triggered.
Sunday, 26 May 13
Conclusions
• CyCQL-2.0 is open source
<http://code.google.com/p/gloze/>.
• A useful addition to the OpenCyc tool-box.
• Jena/ARQ is a flexible framework for developing
SPARQL adapters.
• Enables backward-chaining reasoning in RDF.
• Need to develop the RDF mapping to support NARTs
(Non-Atomic Reified Terms) e.g. (#$MoonFn #$PlanetPluto)
• Support multiple FROM clauses?
• Add SPARQL 1.1 Update
Sunday, 26 May 13

More Related Content

Viewers also liked

Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Steven Battle
 
Architect Concept - .NET Interview Senior / Mid Level
Architect Concept - .NET Interview Senior / Mid Level Architect Concept - .NET Interview Senior / Mid Level
Architect Concept - .NET Interview Senior / Mid Level
Asher Jawad
 
Introduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and TerminologyIntroduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and Terminology
Steven Miller
 
Ontology
OntologyOntology
Flipflop
FlipflopFlipflop
Flipflop
sohamdodia27
 

Viewers also liked (6)

Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
 
Architect Concept - .NET Interview Senior / Mid Level
Architect Concept - .NET Interview Senior / Mid Level Architect Concept - .NET Interview Senior / Mid Level
Architect Concept - .NET Interview Senior / Mid Level
 
Introduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and TerminologyIntroduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and Terminology
 
Flip flop
Flip flopFlip flop
Flip flop
 
Ontology
OntologyOntology
Ontology
 
Flipflop
FlipflopFlipflop
Flipflop
 

Similar to CycQL: A SPARQL Adapter for OpenCyc

Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabilty
kim.mens
 
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Denis Radin
 
Toward Next Generation of Gazetteer: Utilizing GeoSPARQL For Developing Link...
Toward Next Generation of Gazetteer:  Utilizing GeoSPARQL For Developing Link...Toward Next Generation of Gazetteer:  Utilizing GeoSPARQL For Developing Link...
Toward Next Generation of Gazetteer: Utilizing GeoSPARQL For Developing Link...
Dongpo Deng
 
LogicObjects
LogicObjectsLogicObjects
LogicObjects
Sergio Castro
 
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
IT Event
 
C-GeoSPARQL: Streaming geospatial support on C-SPARQL
C-GeoSPARQL: Streaming geospatial support on C-SPARQLC-GeoSPARQL: Streaming geospatial support on C-SPARQL
C-GeoSPARQL: Streaming geospatial support on C-SPARQL
Alexander Dejonghe
 
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem novaKotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Víctor Leonel Orozco López
 
Computational Training and Data Literacy for Domain Scientists
Computational Training and Data Literacy for Domain ScientistsComputational Training and Data Literacy for Domain Scientists
Computational Training and Data Literacy for Domain Scientists
Joshua Bloom
 
Solar System Processing with LSST: A Status Update
Solar System Processing with LSST: A Status UpdateSolar System Processing with LSST: A Status Update
Solar System Processing with LSST: A Status Update
Mario Juric
 
Astronomical Data Processing on the LSST Scale with Apache Spark
Astronomical Data Processing on the LSST Scale with Apache SparkAstronomical Data Processing on the LSST Scale with Apache Spark
Astronomical Data Processing on the LSST Scale with Apache Spark
Databricks
 
Alfonso Senatore
Alfonso SenatoreAlfonso Senatore
Alfonso Senatore
CoupledHydrologicalModeling
 
Reaching the lambda heaven
Reaching the lambda heavenReaching the lambda heaven
Reaching the lambda heaven
Víctor Leonel Orozco López
 
Round Table Introduction: Analytics on 100 TB+ catalogs
Round Table Introduction: Analytics on 100 TB+ catalogsRound Table Introduction: Analytics on 100 TB+ catalogs
Round Table Introduction: Analytics on 100 TB+ catalogs
Mario Juric
 
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
Databricks
 
Correctness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQLCorrectness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQL
Nicolas Poggi
 
What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)
mikaelbarbero
 
CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018
Scilab
 
The Emerging Cyberinfrastructure for Earth and Ocean Sciences
The Emerging Cyberinfrastructure for Earth and Ocean SciencesThe Emerging Cyberinfrastructure for Earth and Ocean Sciences
The Emerging Cyberinfrastructure for Earth and Ocean Sciences
Larry Smarr
 
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training AlgorithmsExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
IRJET Journal
 
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
Roger Huang
 

Similar to CycQL: A SPARQL Adapter for OpenCyc (20)

Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabilty
 
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
 
Toward Next Generation of Gazetteer: Utilizing GeoSPARQL For Developing Link...
Toward Next Generation of Gazetteer:  Utilizing GeoSPARQL For Developing Link...Toward Next Generation of Gazetteer:  Utilizing GeoSPARQL For Developing Link...
Toward Next Generation of Gazetteer: Utilizing GeoSPARQL For Developing Link...
 
LogicObjects
LogicObjectsLogicObjects
LogicObjects
 
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
 
C-GeoSPARQL: Streaming geospatial support on C-SPARQL
C-GeoSPARQL: Streaming geospatial support on C-SPARQLC-GeoSPARQL: Streaming geospatial support on C-SPARQL
C-GeoSPARQL: Streaming geospatial support on C-SPARQL
 
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem novaKotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
 
Computational Training and Data Literacy for Domain Scientists
Computational Training and Data Literacy for Domain ScientistsComputational Training and Data Literacy for Domain Scientists
Computational Training and Data Literacy for Domain Scientists
 
Solar System Processing with LSST: A Status Update
Solar System Processing with LSST: A Status UpdateSolar System Processing with LSST: A Status Update
Solar System Processing with LSST: A Status Update
 
Astronomical Data Processing on the LSST Scale with Apache Spark
Astronomical Data Processing on the LSST Scale with Apache SparkAstronomical Data Processing on the LSST Scale with Apache Spark
Astronomical Data Processing on the LSST Scale with Apache Spark
 
Alfonso Senatore
Alfonso SenatoreAlfonso Senatore
Alfonso Senatore
 
Reaching the lambda heaven
Reaching the lambda heavenReaching the lambda heaven
Reaching the lambda heaven
 
Round Table Introduction: Analytics on 100 TB+ catalogs
Round Table Introduction: Analytics on 100 TB+ catalogsRound Table Introduction: Analytics on 100 TB+ catalogs
Round Table Introduction: Analytics on 100 TB+ catalogs
 
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
Correctness and Performance of Apache Spark SQL with Bogdan Ghit and Nicolas ...
 
Correctness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQLCorrectness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQL
 
What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)What's new in Eclipse Oxygen (Devoxx France 2017)
What's new in Eclipse Oxygen (Devoxx France 2017)
 
CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018CNES @ Scilab Conference 2018
CNES @ Scilab Conference 2018
 
The Emerging Cyberinfrastructure for Earth and Ocean Sciences
The Emerging Cyberinfrastructure for Earth and Ocean SciencesThe Emerging Cyberinfrastructure for Earth and Ocean Sciences
The Emerging Cyberinfrastructure for Earth and Ocean Sciences
 
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training AlgorithmsExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
ExoSGAN and ExoACGAN: Exoplanet Detection using Adversarial Training Algorithms
 
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
Intro to Apache Spark and Scala, Austin ACM SIGKDD, 7/9/2014
 

More from Steven Battle

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with Twine
Steven Battle
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese Dragons
Steven Battle
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in Python
Steven Battle
 
Droid Geometry
Droid GeometryDroid Geometry
Droid Geometry
Steven Battle
 
Squishy logic
Squishy logicSquishy logic
Squishy logic
Steven Battle
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostat
Steven Battle
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python Way
Steven Battle
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture Evaluation
Steven Battle
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural Vehicles
Steven Battle
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2
Steven Battle
 
Robots Are GO!
Robots Are GO!Robots Are GO!
Robots Are GO!
Steven Battle
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM Assembler
Steven Battle
 
Processing 2.0 + Open Data
Processing 2.0 + Open DataProcessing 2.0 + Open Data
Processing 2.0 + Open Data
Steven Battle
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDF
Steven Battle
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2
Steven Battle
 

More from Steven Battle (15)

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with Twine
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese Dragons
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in Python
 
Droid Geometry
Droid GeometryDroid Geometry
Droid Geometry
 
Squishy logic
Squishy logicSquishy logic
Squishy logic
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostat
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python Way
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture Evaluation
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural Vehicles
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2
 
Robots Are GO!
Robots Are GO!Robots Are GO!
Robots Are GO!
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM Assembler
 
Processing 2.0 + Open Data
Processing 2.0 + Open DataProcessing 2.0 + Open Data
Processing 2.0 + Open Data
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDF
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2
 

Recently uploaded

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

CycQL: A SPARQL Adapter for OpenCyc

  • 1. CycQL:A SPARQL Adapter for OpenCyc Steve Battle @stevebattle stevebattle@me.com http://www.stevebattle.me http://code.google.com/p/gloze/ Sunday, 26 May 13
  • 2. OpenCyc 4.0 • Cyc was one of the first Artificial Intelligence systems to develop an ontological approach to organizing knowledge. • OpenCyc 4.0, released in June 2012, includes the full Cyc ontology. • Java API. Sunday, 26 May 13
  • 3. CycL • A declarative language based on classical first-order logic. • Includes Atomic and Non-AtomicTerms (NATs). (#$orbits #$PlanetPluto #$TheSun) (#$isa #$PlanetPluto #$DwarfPlanet) (#$orbitalPeriod #$PlanetPluto (#$DaysDuration 90739)) (#$isa #$Charon-MoonOfPluto (#$MoonFn #$PlanetPluto)) (#$and (#$isa ?PLANET #$DwarfPlanet) (#$orbits ?PLANET #$TheSun) ) Sunday, 26 May 13
  • 4. RDF(CycL) • Set the base URI base and prepend to Atomic terms. e.g. to <<http://sw.opencyc.org/2012/05/10/concept/en/> • Transpose the order of the terms to give the typical subject, predicate, object. @base <http://sw.opencyc.org/2012/05/10/concept/en/> . <PlanetPluto> <orbits> <TheSun> . <PlanetPluto a <DwarfPlanet> . <Charon-MoonOfPluto> <orbits> <PlanetPluto> . <PlanetPluto> <orbitalPeriod> "90739"^^<DaysDuration> . <PlanetPluto> <MoonFn> _:MoonOfPluto . <Charon-MoonOfPluto> a _:MoonOfPluto . Sunday, 26 May 13
  • 5. SPARQL(RDF(CycL)) PREFIX : <> SELECT ?planet ?moon WHERE { ?planet a :DwarfPlanet ; :orbits :TheSun ?moon :orbits ?planet . } ---------------------------------------- | planet | moon | ======================================== | :PlanetPluto | :Charon-MoonOfPluto | | :PlanetPluto | :Nix-MoonOfPluto | | :PlanetPluto | :Hydra-MoonOfPluto | | :PlanetPluto | :Vulcan-MoonOfPluto | | :PlanetPluto | :Cerberus-MoonOfPluto | ---------------------------------------- (#$and (#$isa ?PLANET #$DwarfPlanet) (#$orbits ?PLANET #$TheSun) (#$orbits ?MOON ?PLANET) ) Full-query compilation issues: • OPTIONAL left-join • ORDER BY clause • Named GRAPH clause Sunday, 26 May 13
  • 6. Microtheories • Cyc’s knowledge-base is divided into microtheories. • Microtheories are hierarchically organized. CurrentWorldDataCollectorMt-NonHomocentric UniverseDataMt (#$orbits #$PlanetPluto #$TheSun) (#$orbits #$PlanetEarth #$TheSun) (#$isa #$PlanetPluto #$DwarfPlanet) SELECT * FROM :CurrentWorldDataCollectorMt-NonHomocentric FROM NAMED :UniverseDataMt WHERE { ! GRAPH :UniverseDataMt { ! ! ?planet a :Planet ; :orbits :TheSun ! } ! FILTER (NOT EXISTS { ?planet a :DwarfPlanet }) } Sunday, 26 May 13
  • 7. Compilation Levels PREFIX : <> SELECT ?planet ?orbital_period FROM :CurrentWorldDataCollectorMt-NonHomocentric WHERE { ?planet a :Planet ; :orbits :TheSun ; :orbitalPeriod ?orbital_period FILTER (NOT EXISTS { ?planet a :DwarfPlanet }) } 0 20 40 60 80 triple/quad bgp operator Cyc requests Sunday, 26 May 13
  • 8. CycL Functions • CycL defines functions expressed as NATs. e.g. #$ExponentFn, #$QuotientFn • This expression defines Kepler’s 3rd law, the relationship between the orbital radius in AUs, and its orbital period, P: (#$evaluate ?AU (#$ExponentFn (#$QuotientFn ?P 365) (#$QuotientFn 2 3))) • Expressed in SPARQL using ARQ’s LET clause: PREFIX cyc: <http://www.opencyc.org#> PREFIX nat: <java:org.opencyc.sparql.function.nat.> PREFIX : <> SELECT ?planet ?AU FROM :UniverseDataMt WHERE { ?planet a :Planet ; :orbits :TheSun ; :orbitalPeriod ?p LET (?AU := cyc:ExponentFn(cyc:QuotientFn(nat:Double(?p),365), cyc:QuotientFn(2,3))) } ORDER BY ?AU Sunday, 26 May 13
  • 9. CycL Rules • The real purpose of CycQL is to provide access to Cyc inference from SPARQL. • Define a CycL rule that computes the orbital radius: (#$implies (#$and (#$orbitalPeriod ?BODY (#$DaysDuration ?P)) (#$evaluate ?AU (#$ExponentFn (#$QuotientFn ?P 365) (#$QuotientFn 2 3)))) (#$orbitalRadius ?BODY (#$AstronomicalUnits ?AU)) ) Sunday, 26 May 13
  • 10. Magic Predicates PREFIX nat: <java:org.opencyc.sparql.function.nat.> PREFIX : <> SELECT * FROM :UniverseDataMt WHERE { ?planet a :Planet ; :orbits :TheSun ; :orbitalRadius ?AU FILTER (0.725 < nat:Double(?AU) && nat:Double(?AU) < 3.0) } ORDER BY nat:Double(?AU) --------------------------------------------------- | planet | AU | =================================================== | :PlanetEarth | "1.0"^^xsd:double | | :PlanetMars | "1.5244361831950344"^^xsd:double | --------------------------------------------------- • The Goldilock’s Zone lies between 0.725 and 3 AUs. When Cyc searches for #$orbitalRadius backward- chaining rule evaluation is triggered. Sunday, 26 May 13
  • 11. Conclusions • CyCQL-2.0 is open source <http://code.google.com/p/gloze/>. • A useful addition to the OpenCyc tool-box. • Jena/ARQ is a flexible framework for developing SPARQL adapters. • Enables backward-chaining reasoning in RDF. • Need to develop the RDF mapping to support NARTs (Non-Atomic Reified Terms) e.g. (#$MoonFn #$PlanetPluto) • Support multiple FROM clauses? • Add SPARQL 1.1 Update Sunday, 26 May 13