SlideShare a Scribd company logo
1 of 11
Download to read offline
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 (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
 

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

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

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

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