design and implementation of an rdf data store
DESCRIPTION
Design and Implementation of An RDF Data Store. Ching-Long Yeh 葉慶隆 Department of Computer Science and Engineering Tatung University Email: [email protected] URL: httP://www.cse.ttu.edu.tw/chingyeh. Outline. Introduction to the Semantic Web Semantic Web Layered Architecture: - PowerPoint PPT PresentationTRANSCRIPT
Design and Implementation of An RDF Data Store
Ching-Long Yeh 葉慶隆Department of Computer Science and EngineeringTatung UniversityEmail: [email protected]: httP://www.cse.ttu.edu.tw/chingyeh
An RDF Data Store 2
OutlineOutline
• Introduction to the Semantic Web• Semantic Web Layered Architecture:
– XML, RDF(S), DAML(-S)
• The Big Picture of the Semantic Web• An Architecture of RDF Triple Data Store
– An RDF Parser in Prolog– The Repository storage– APIs and User Interface
• Semantic Community Portal• Future Work and Conclusions
An RDF Data Store 3
SourcesSources
• Part of the slides are selected from the following sources:– Knowledge Markup and Resource Semantics, By
Harold Boley, Stefan Decker, and Michael Sintek, IJCAI-01 Tutorial, http://www.ijcai-01.org/
– Anupriya Ankolenkar, et al., “DAML-S: Semantic Markup For Web Services,”, Proceedings of SWWS’ 01, the First Semantic Web Working Symposium, California, USA, July 30 - August 1, 2001.
An RDF Data Store 4
Introduction to Semantic WebIntroduction to Semantic Web
• Facilities to put machine-understandable data on the Web are becoming a high priority for many communities.
• The Web can reach its full potential only if it becomes a place where data can be shared and processed by automated tools as well as by people.
• For the Web to scale, tomorrow's programs must be able to share and process data even when these programs have been designed totally independently.
An RDF Data Store 5
Introduction to Semantic WebIntroduction to Semantic Web
• The Semantic Web is a vision: the idea of having data on the web defined and linked in a way that it can be used by machines not just for display purposes, but for automation, integration and reuse of data across various applications.
• See “W3C Semantic Web Activity,” by Marja-Riitta Koivunen, for more descriptions.
An RDF Data Store 6
The Semantic Web Layered ArchitectureThe Semantic Web Layered Architecture
(http://www.w3.org/2001/Talks/0228-tbl/slide5-0.html)
Tim Berners-Lee:“Axioms, Architecture and Aspirations”W3C all-working group plenary Meeting28 February 2001
An RDF Data Store 7
AI’s ChanceAI’s Chance
• Increasing demand for formalized knowledge on the Web: AI’s chance!
• XML- & RDF-based markup languages provide a 'universal' storage/interchange format for such Web-distributed knowledge representation.
DTDs
XML
RDF[S]
Namespaces
Stylesheets
CSS
XSLT
XQL
Queries
XML-QL
Transformations
Acquisition
Protégé
Agents
Frames
Rules
SHOE
HornML
RuleML
DAML
XQuery
TopicMaps
Ontobroker
XML FundamentalsXML Fundamentals
Source: http://www.ibiblio.org/xml/slides/sd2001east/fundamentals/XML_Fundamentals.html
An RDF Data Store 9
What is XML?What is XML?
• Extensible Markup Language• A syntax for documents • A Meta-Markup Language• A Structural and Semantic language, not a
formatting language• Not just for Web pages
An RDF Data Store 10
Extensible Markup LanguageExtensible Markup Language
• Language – It has a grammar– It has a vocabulary (sort of)– It can be parsed by machines
• Markup Language– It says what things are; not what they do– It is not a programming language– It is not compiled
• Extensible – You can add words to the language
An RDF Data Store 11
XML is a Meta Markup LanguageXML is a Meta Markup Language
• Not like HTML, troff, LaTeX• Make up the tags you need as you need them• The tags you create can be documented in a
Document Type Definition (DTD)• A meta syntax for domain-specific markup
languages like MusicML, MathML, and XHTML
An RDF Data Store 12
XML ApplicationsXML Applications
• A specific markup language that uses the XML meta-syntax is called an XML application
• Different XML applications have their own more constricted syntaxes and vocabularies within the broader XML syntax
• Further syntax can be layered on top of this; e.g. data typing through schemas
An RDF Data Store 13
XML describes structure and XML describes structure and semantics, not formattingsemantics, not formatting
• XML documents form a tree– Document Object Model (DOM)
• Element and attribute names reflect the kind of the element– DTD, Schema
• Formatting can be added with a style sheet– Cascading Style Sheets (CSS)– Extensible Stylesheet language (XSL)
An RDF Data Store 14
XML HypertextXML Hypertext
• A Uniform Resource Identifier (URI) names or locates a resource
• An XLink defines connections between two or more documents identified by URIs
• XPath identifies particular nodes within a document
• An XPointer adds an XPath to a URI• XBase defines the URI against which relative
URIs are resolved • XInclude embeds a document identified by a
URI inside an XML document.
An RDF Data Store 15
A Song Description in HTMLA Song Description in HTML
<dt>Hot Cop<dd> by Jacques Morali, Henri Belolo, and Victor Willis<ul><li>Producer: Jacques Morali<li>Publisher: PolyGram Records<li>Length: 6:20<li>Written: 1978<li>Artist: Village People</ul>
An RDF Data Store 16
A Song Description in XMLA Song Description in XML
<SONG> <TITLE>Hot Cop</TITLE> <COMPOSER>Jacques Morali</COMPOSER> <COMPOSER>Henri Belolo</COMPOSER> <COMPOSER>Victor Willis</COMPOSER> <PRODUCER>Jacques Morali</PRODUCER> <PUBLISHER>PolyGram Records</PUBLISHER> <LENGTH>6:20</LENGTH> <YEAR>1978</YEAR> <ARTIST>Village People</ARTIST></SONG>
An RDF Data Store 17
Style Sheets Provide FormattingStyle Sheets Provide Formatting(CSS)(CSS)
SONG {display: block; font-family: New York, Times New Roman, serif}TITLE {display: block; font-size: 24pt; font-weight: bold; font-family: Helvetica, sans}COMPOSER {display: block}PRODUCER {display: block}YEAR {display: block}PUBLISHER {display: block}LENGTH {display: block}ARTIST {display: block; font-style: italic}
An RDF Data Store 18
Attaching Style Sheets to DocumentsAttaching Style Sheets to Documents
<?xml-stylesheet type="text/css" href="song.css"?><SONG> <TITLE>Hot Cop</TITLE> <COMPOSER>Jacques Morali</COMPOSER> <COMPOSER>Henri Belolo</COMPOSER> <COMPOSER>Victor Willis</COMPOSER> <PRODUCER>Jacques Morali</PRODUCER> <PUBLISHER>PolyGram Records</PUBLISHER> <LENGTH>6:20</LENGTH> <YEAR>1978</YEAR> <ARTIST>Village People</ARTIST></SONG>
An RDF Data Store 19
An XSLT Stylesheet (Part 1)An XSLT Stylesheet (Part 1)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <html> <head><title>Song</title></head> <body> <xsl:apply-templates select="SONG"/> </body> </html> </xsl:template>
An RDF Data Store 20
An XSLT Stylesheet (Part 2)An XSLT Stylesheet (Part 2) <xsl:template match="SONG"> <h1> <xsl:value-of select="TITLE"/> by the <xsl:value-of select="ARTIST"/> </h1> <ul> <li>Length: <xsl:value-of select="LENGTH"/></li> <li>Producer: <xsl:value-of select="PRODUCER"/></li> <li>Publisher: <xsl:value-of select="PUBLISHER"/></li> <li>Year: <xsl:value-of select="YEAR"/></li> <xsl:apply-templates select="COMPOSER"/> </ul> </xsl:template>
<xsl:template match="COMPOSER"> <li>Composer: <xsl:value-of select="."/></li> </xsl:template></xsl:stylesheet>
An RDF Data Store 21
Transforming the DocumentTransforming the Document<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Song</title> </head> <body> <h1>Hot Cop by the Village People </h1> <ul> <li>Length: 6:20</li> <li>Producer: Jacques Morali</li> <li>Publisher: PolyGram Records</li> <li>Year: 1978</li> <li>Composer: Jacques Morali</li> <li>Composer: Henri Belolo</li> <li>Composer: Victor Willis</li> </ul> </body></html>
XSLT Processor
(IE 5)
XSL document(template rules)
XML document
Output
An RDF Data Store 22
A DTD for SongsA DTD for Songs
<!ELEMENT SONG (TITLE, COMPOSER+, PRODUCER*, PUBLISHER*, LENGTH?, YEAR?, ARTIST+)>
<!ELEMENT TITLE (#PCDATA)>
<!ELEMENT COMPOSER (#PCDATA)><!ELEMENT PRODUCER (#PCDATA)><!ELEMENT PUBLISHER (#PCDATA)><!ELEMENT LENGTH (#PCDATA)><!-- This should be a four digit year like "1999", not a two-digit year like "99" --><!ELEMENT YEAR (#PCDATA)>
<!ELEMENT ARTIST (#PCDATA)>
An RDF Data Store 23
Well-formednessWell-formedness
• Rules:– Open and close all tags– Empty tags end with />– There is a unique root element– Elements may not overlap– Attribute values are quoted– < and & are only used to start tags and entities– Only the five predefined entity references are used– Plus more...
An RDF Data Store 24
ValidityValidity
• To be valid an XML document must be1. Well-formed2. Must have a Document Type Definition
(DTD)3. Must comply with the constraints specified
in the DTD
An RDF Data Store 25
What Is XML Used for?What Is XML Used for?
• Domain-Specific Markup Languages– XML in industrial applications:
http://www.xml.org/xml/industry_industrysectors.jsp
• Self-Describing Data– Much data is lost due to format problems.
• Interchange of Data Among Applications– Electronic business: RosettaNet, ebXML
An RDF Data Store 26
XML NamespacesXML Namespaces
• XML namespaces are akin to namespaces, packages, and modules in programming languages
• Disambiguation of tag–and attribute–names from different XML applications (“spaces”) through different prefixes
• A prefix is separated from the local name by a “:”, obtaining prefix:name tags
• Namespaces constitute a layer on top of XML 1.0, since prefix:name is again a valid tag name and namespace bindings are ignored by some tools
An RDF Data Store 27
Namespace BindingsNamespace Bindings
• Prefixes are bound to namespace URIs by attaching an xmlns:prefix attribute to the prefixed
element or one of its ancestors, prefix:name1 ,...,
prefix:namen
• The value of the xmlns:prefix attribute is a URI, which may or (unlike for DTDs!) may not point to a description of the namespace’s syntax
• An element can use bindings for multiple name-
spaces via attributes xmlns:prefix1 ,...,
xmlns:prefixm
An RDF Data Store 28
Two-Namespace Example:Two-Namespace Example:Snail-Mail and Telecoms Address PartsSnail-Mail and Telecoms Address Parts
<mail:address xmlns:mail="http://www.deutschepost.de/" xmlns:tele="http://www.telekom.de/"> <mail:name>Xaver M. Linde</mail:name> <mail:street>Wikingerufer 7</mail:street> <mail:town>10555 Berlin</mail:town> <mail:bill>12.50</mail:bill> <tele:phone>030/1234567</tele:phone> <tele:phone>030/1234568</tele:phone> <tele:fax>030/1234569</tele:fax> <tele:bill>76.20</tele:bill></ mail:address>
bill disambiguation through mail and tele prefixes
Introduction to RDFIntroduction to RDF• RDF (Resource Description Framework)
– Beyond Machine readable to Machine understandable
• RDF unites a wide variety of stakeholders:– Digital librarians, content-raters, privacy advocates,
B2B industries, AI...– Significant (but less than XML) industrial momentum,
lead by W3C
• RDF consists of two parts– RDF Model (a set of triples)– RDF Syntax (different XML serialization syntaxes)
• RDF Schema for definition of Vocabularies (simple Ontologies) for RDF (and in RDF)
Knowledge Markup and Resource Semantics, By Harold Boley, Stefan Decker, and Michael Sintek, IJCAI-01 Tutorial, http://www.ijcai-01.org/
An RDF Data Store 30
RDF Data ModelRDF Data Model• Resources
– A resource is a thing you talk about (can reference)– Resources have URI’s– RDF definitions are themselves Resources (linkage,
see requirement 1)
• Properties – slots, define relationships to other resources or atomic
values
• Statements– “Resource has Property with Value”– (Values can be resources or atomic XML data)
• Similar to Frame Systems
An RDF Data Store 31
A Simple ExampleA Simple Example• Statement
– “Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila”
• Structure– Resource (subject) http://www.w3.org/Home/Lassila– Property (predicate) http://www.schema.org/#Creator– Value (object) "Ora Lassila”
• Directed graph
http://www.w3.org/Home/Lassilas:Creator
Ora Lassila
An RDF Data Store 32
EmailName
s:Creator
http://www.w3.org/Home/Lassila
Another ExampleAnother Example
• To add properties to Creator, point through an intermediate Resource.
Person://fi/654645635
Ora Lassila [email protected]
An RDF Data Store 33
Collection ContainersCollection Containers
• Multiple occurrences of the same PropertyType don’t establish a relation between the values– The Millers own a boat, a bike, and a TV set– The Millers need (a car or a truck)– (Sarah and Bob) bought a new car
• RDF defines three special Resources:– Bag unordered values rdf:Bag
– Sequence ordered values rdf:Seq
– Alternative single value rdf:Alt• Core RDF does not enforce ‘set’ semantics amongst
values
An RDF Data Store 34
Example:Example: Bag Bag
• The students incourse 6.001 are Amy, Tim,John, Mary,and Sue
Rdf:Bag
/Students/Amy
/Students/Tim
/Students/John
/Students/Mary
/Students/Sue
bagid1
/courses/6.001
students
rdf:type
rdf:_1
rdf:_2
rdf:_3
rdf:_4
rdf:_5
An RDF Data Store 35
rdf:_1
rdf:_2
rdf:_3
rdf:typesource
ftp.eu.net
ftp.cs.purdue.edu
ftp.x.org
Example:Example: Alternative Alternative
• The source code for X11 may be found at ftp.x.org, ftp.cs.purdue.edu, or ftp.eu.net
altid
rdf:Althttp://x.org/package/X11
An RDF Data Store 36
Statements About StatementsStatements About Statements
• Making statements about statements requires a
process for transforming them into Resources
– subject the original resource
– predicate the original property
– object the original value
– type rdf:Statement
An RDF Data Store 37
Statements About StatementsStatements About Statements
Ralph Swick says that Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila.
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:a="http://description.org/schema/"> <rdf:Description> <rdf:subject resource="http://www.w3.org/Home/Lassila" /> <rdf:predicate resource="http://description.org/schema/Creator" /> <rdf:object>Ora Lassila</rdf:object> <rdf:type resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /> <a:attributedTo>Ralph Swick</a:attributedTo> </rdf:Description></rdf:RDF>
An RDF Data Store 38
http://www.w3.org/Home/Lassila
rdf:Statement s:Creator
Ora Lasilla
Ralph Swick
rdf:object
rdf:predicate
a:attributedTo
rdf:type
rdf:subject
Representation of a reified statement
An RDF Data Store 39
Statements About StatementsStatements About Statements
<rdf:RDF> <rdf:Description about="http://www.w3.org/Home/Lassila" bagID="D_001"> <s:Creator>Ora Lassila</s:Creator> <s:Title>Ora's Home Page</s:Title> </rdf:Description> <rdf:Description aboutEach="#D_001"> <a:attributedTo>Ralph Swick</a:attributedTo> </rdf:Description></rdf:RDF>
An RDF Data Store 40
RDF Syntax IRDF Syntax I
• Data model does not enforce particular syntax• Specification suggests many different syntaxes
based on XML• General form:
<rdf:RDF> <rdf:Description about="http://www.w3.org/Home/Lassila"> <s:Creator>Ora Lassila</s:Creator> <s:createdWith rdf:resource=“http://www.w3c.org/amaya”/> </rdf:Description></rdf:RDF>
Starts an RDF-Description
Properties
Subject (OID)
Literal
Resource (possibly another RDF-description)
An RDF Data Store 41
Resulting GraphResulting Graph
<rdf:RDF> <rdf:Description about="http://www.w3.org/Home/Lassila"> <s:Creator>Ora Lassila</s:Creator> <s:createdWith rdf:resource=“http://www.w3c.org/amaya”/> </rdf:Description></rdf:RDF>
http://www.w3c.org/amaya
http://www.w3.org/Home/Lassila
Ora Lassila
s:createdWiths:Creator
RDF Syntax II: Syntactic VarietiesRDF Syntax II: Syntactic Varieties
<s:Homepage rdf:about="http://www.w3.org/Home/Lassila” s:Creator=“Ora Lassila”/>
<s:createdWith> <s:HTMLEditor rdf:about=“http://www.w3c.org/amaya”/> </s:createdWith> </s:Homepage>
Typing InformationIn-Element Property
Property
Subject (OID)
http://www.w3c.org/amaya
http://www.w3.org/Home/Lassila
Ora Lassila
s:createdWiths:Creator
HTMLEditor
s:Homepagerdf:type
rdf:type
RDF SchemaRDF Schema
An RDF Data Store 44
RDF Schema (RDFS)RDF Schema (RDFS)
• RDF just defines the data model
• Need for definition of vocabularies for the data model - an
Ontology Language!
• The RDF Schema mechanism provides a basic type
system for use in RDF models.
• The RDF schema specification language is less
expressive, but much simpler to implement, than full
predicate calculus languages such as CycL and KIF.
An RDF Data Store 45
Most Important Modeling PrimitivesMost Important Modeling Primitives
• Core Classes– Root-Class rdfs:Resource
– MetaClass rdfs:Class
– Literals rdfs:Literal
• rdfs:subclassOf-property
• Inherited from RDF: properties (slots)• rdfs:domain & rdfs:range• rdfs:label, rdfs:comment, etc.
• Inherited from RDF: InstanceOf (rdf:type)
Classes and PropertiesClasses and Properties
Resources
Classes
Property
ConstraintProperty
•rdf:type•rdfs:subClassOf•rdfs:subPropertyOf•rdfs:comment•rdfs:label•rdfs:seeAlso•rdfs:isDefinedBy
•rdfs:domain•rdfs:range
•rdfs:Resource•rdfs:Class•rdf:Property•rdfs:ConstraintProperty•rdfs:Literal
Classes and Resources as Sets and Elements
DARPA Agent Markup LanguageDARPA Agent Markup LanguageDAMLDAML
An RDF Data Store 48
DARPA Agent Markup Language DARPA Agent Markup Language ProgramProgram
• DARPA funded Research Program (also funded the Development of the ARPANNET -> Internet)
• Focusing on building the foundation for the Semantic Web: http://www.daml.org
• Ontology Language DAML+OIL: Result of a Joint (European + US-American) Committee
• Rule Language in preparation
An RDF Data Store 49
DAML+OILDAML+OIL
• Extension of RDF Schema• Ontology Language DAML+OIL: Result of a
Joint (European + US-American) Committee• Extension of RDF Schema
– Class Expressions (Intersection, Union, Complement)– XML Schema Datatypes– Enumerations– Property Restrictions
• Cardinality Constraints• Value Restrictions
An RDF Data Store 50
Example: Intersection & SynonymsExample: Intersection & Synonyms
<daml:Class rdf:ID="TallMan"> <daml:intersectionOf rdf:parseType="daml:collection">
<daml:Class rdf:about="#TallThing"/> <daml:Class rdf:about="#Man"/>
</daml:intersectionOf> </daml:Class>
<daml:Class rdf:ID="HumanBeing"><daml:sameClassAs rdf:resource="#Person"/>
</daml:Class>
An RDF Data Store 51
Example: Disjoint & ComplementExample: Disjoint & Complement<daml:Disjoint rdf:parseType="daml:collection"><daml:Class rdf:about="#Car"/> <daml:Class rdf:about="#Person"/> <daml:Class rdf:about="#Plant"/>
</daml:Disjoint>
<daml:Class rdf:ID="Car"><rdfs:comment>no car is a person</rdfs:comment> <rdfs:subClassOf>
<daml:Class><daml:complementOf rdf:resource="#Person"/>
</daml:Class> </rdfs:subClassOf>
</daml:Class>
Disjoint not strictly necessary, since expressible via pairwise subClassOfof complementOf, as for Car and Person:
An RDF Data Store 52
Example: Properties Example: Properties (Transitive, Inverse, subProperty, UniqueProperty, range, (Transitive, Inverse, subProperty, UniqueProperty, range,
Datatypes)Datatypes)
<daml:TransitiveProperty rdf:ID="hasAncestor"/>
<daml:ObjectProperty rdf:ID="hasChild"><daml:inverseOf rdf:resource="#hasParent"/>
</daml:ObjectProperty>
<daml:UniqueProperty rdf:ID="hasMother"><rdfs:subPropertyOf rdf:resource="#hasParent"/><rdfs:range rdf:resource="#Female"/>
</daml:UniqueProperty>
<daml:DatatypeProperty rdf:ID="age"><rdf:type rdf:resource="http://www.daml.org/2001/03/daml+oil#UniqueProperty"/><rdfs:range rdf:resource="http://www.w3.org/.../XMLSchema#nonNegativeInteger"/>
</daml:DatatypeProperty>
An RDF Data Store 53
Using User-defined DatatypesUsing User-defined Datatypes(based on XML Schema)(based on XML Schema)
<xsd:simpleType name="over17"><!--over17 is an XMLS datatype based on decimal--> <!--with the added restriction that values must be >=18--> <xsd:restriction base="xsd:decimal"> <xsd:minInclusive value="18"/> </xsd:restriction>
</xsd:simpleType>
<daml:Class rdf:ID="Adult"><daml:intersectionOf rdf:parseType="daml:collection">
<daml:Class rdf:about="#Person"/> <daml:Restriction><daml:onProperty rdf:resource="#age"/><daml:hasClass rdf:resource="somefile#over17"/>
</daml:Restriction> </daml:intersectionOf> </daml:Class>
An RDF Data Store 54
Instances (Individuals)Instances (Individuals)
<Person rdf:ID="Adam"> <rdfs:label>Adam</rdfs:label> <rdfs:comment>Adam is a person.</rdfs:comment> <age><xsd:integer rdf:value="13"/></age> <shoesize>
<xsd:decimal rdf:value="9.5"/></shoesize>
</Person>
<daml:Class rdf:ID="Person"> . . .</daml:Class>
Semantic Web ServicesSemantic Web Services
Source: Anupriya Ankolenkar, et al., “DAML-S: Semantic Markup For Web Services,”, Proceedings of SWWS’ 01, the First Semantic Web Working Symposium, California, USA, July 30 - August 1, 2001
An RDF Data Store 56
Web ServicesWeb Services
Serviceregistry
Servicerequester
Serviceprovider
FindWSDL, UDDI
PublishWSDL, UDDI
Bind
Servicedescriptions
Servicedescriptions
Services
An RDF Data Store 57
What Is DAML-SWhat Is DAML-S
• Users and software agents should be able to discover, invoke, compose, and monitor Web resources offering particular services and having particular properties.
• As part of the DARPA Agent Markup Language program, we have begun to develop an ontology of services, called DAML-S.
An RDF Data Store 58
Some Motivating TasksSome Motivating Tasks
• Automatic Web service discovery• Automatic Web service invocation• Automatic Web service composition and
interoperation• Automatic Web service execution
monitoring
An RDF Data Store 59
Top Level of the Service OntologyTop Level of the Service Ontology
Service
Resource
ServiceGrounding
ServiceProfile
ServiceModel
provide presents
supports
describedBy
(what it does)
(how it works)
(how to access it)
An RDF Data Store 60
Process Modeling OntologyProcess Modeling Ontology
The Big The Big Picture of Picture of
SWSW
An RDF Data Store 62
Editing and Annotation ToolsEditing and Annotation Tools
• Protégé-2000• OntoEdit • OilED• Amaya
An Architecture of RDF Triple Data Store
RDFparser andgenerator
Triples in Prologand RDB tables
RDF documentsCrawler
Userinterface
API's(in Prologand SQL)
Editing and Annotation
An RDF Data Store 64
RDF Parser and GeneratorRDF Parser and Generator
• Using DCG in Prolog as the development tool• Formal grammar in RDF M&S Spec
http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#grammar
Prolog’s inference engine
Formal grammar rules in DCG
Prolog’s working storage
User interface
[6.1] RDF ::= ['<rdf:RDF>'] obj* ['</rdf:RDF>'][6.2] obj ::= description | container[6.3] description ::= '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '/>' | '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '>' propertyElt* '</rdf:Description>' | typedNode[6.4] container ::= sequence | bag | alternative
rdf(Objs) --> (['<?'], ([nm/'xml'];[nm/'XML']; [nm/'xmls'];[nm/'XMLS']), ([nm/'version','=',qs/_];[]), ([nm/'encoding','=',qs/_];[]), ['?>'],{wl('XML heading')} ;[]), (fullSTG('RDF',NS) ; halfSTG('RDF',NS), ['>'] ; [ ]), objStar(Objs), (fullETG('RDF',NS);[ ]).
objStar(Out) --> obj(O), objStar(R),{Out=[O|R]} ; [],{Out=[]}.
obj(Obj) --> container(Obj) ; description(_),{getAllTriples(Obj)}.getAllTriples(Obj):- findall(statement(A,B,C),statement(A,B,C),Obj).
description(_) --> halfSTG('Description',NS), (idAboutAttr(IdAboutAttr);[]), (bagIdAttr(BagIdAttr);[]), propAttrStar(IdAboutAttr), (['/>'] ; ['>'],propertyEltStar(IdAboutAttr), fullETG('Description',NS)), {reificationOfStatements(IdAboutAttr,BagIdAttr)} ; typedNode.
[statement(about/http://www.foo.com/cool.html, Title, alt(_87882,[string/The Coolest Web Page, string/Il Pagio di Web Fuba])), statement(about/http://www.foo.com/cool.html, Identifier, bag(id/MirroredSites,[resource/http://www.foo.com.au/cool.html, resource/http://www.foo.com.it/cool.html])), statement(about/http://www.foo.com/cool.html, Creator, seq(id/CreatorsAlphabeticalBySurname,[string/Mary Andrew, string/Jacky Crystal]))]
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/metadata/dublin_core#"> <rdf:Description about="http://www.foo.com/cool.html"> <dc:Creator> <rdf:Seq ID="CreatorsAlphabeticalBySurname">
<rdf:li>Mary Andrew</rdf:li><rdf:li>Jacky Crystal</rdf:li>
</rdf:Seq> </dc:Creator> <dc:Identifier> <rdf:Bag ID="MirroredSites">
<rdf:li rdf:resource="http://www.foo.com.au/cool.html"/><rdf:li rdf:resource="http://www.foo.com.it/cool.html"/>
</rdf:Bag> </dc:Identifier> <dc:Title> <rdf:Alt>
<rdf:li xml:lang="en">The Coolest Web Page</rdf:li><rdf:li xml:lang="it">Il Pagio di Web Fuba</rdf:li>
</rdf:Alt> </dc:Title></rdf:Description></rdf:RDF>
RDF input
Prolog output
RDF Statements in RDB TablesRDF Statements in RDB Tables
Id NsName1 http://www.w3.org/2000/01/rdf#2 http://purl.org/metadata/dublin_core#… …
Id NS PredicateName1 2 Creator2 2 Language… … …
Id ResourceName1 http://www.dlib.org2 http://www.foo.com… …
Id LiteralName1 Jacky Crystal2 English… …
Id Resource Predicate Literal1 1 1 12 1 2 2… … … …
RDF_NameSpace
RDF_Predicate
RDF_Literal
RDF_Statement
RDF_Resource
An RDF Data Store 68
Application Program InterfacesApplication Program Interfaces
• RDF Query language is syntactically verbose.
<rdfquery> <rdfq:From> <rdf:Bag> <li resource="http://www.research.ibm.com/people/ashok/paper1.html"/> <li resource="http://www.research.ibm.com/people/ashok/paper3.html"/> <li resource="http://www.research.ibm.com/people/neel/paper1.html"/> <li resource="http://www.research.ibm.com/people/neel/paper7.html"/> </rdf:Bag> </rdfq:From></rdfquery>
Selecting all resources from a collection
An RDF Data Store 69
Application Program InterfacesApplication Program Interfaces
get_frame - retrieves attribute values for a frame
add_frame - adds or updates attribute values for a frame
del_frame - deletes attribute values from a frame
• We propose a set of frame-based APIs for programmers to access the RDF repository.
An RDF Data Store 70
User InterfaceUser Interface
• Natural language interface is the best choice, but is very difficult to obtain a good result.
• Form-based interface is easy to implement, but is too restricted.
• Hierarchical directory browsing is perhaps a good idea, if the domain in question is well organized.
• We also propose a frame-based query interface.
target_concept[(attribute1[:value1], …)]
teacher(office:6th_floor)
An RDF Data Store 71
Related WorkRelated Work
• Jena– HP Labs in Bristol, England– Jena is an API in the Java programming language, for
the creation and manipulation of RDF graphs
• RDFSuite– ICS, Forth, Greece – The Validating RDF Parser (VRP)– The RDF Schema Specific DataBase (RSSDB) – The RDF Query Language (RQL)
An RDF Data Store 72
Related WorkRelated Work
• CWM (Closed World Machine):– A popular Semantic Web & RDF program, written in
Python by Tim Berners-Lee and Dan Connolly. – It can handle the Notation3 format, as well as XML
RDF and NTriples, and can perform a number of functions, including applying rules as a forward chaining inference engine.
An RDF Data Store 73
Semantic Community PortalSemantic Community Portal
An RDF Data Store 74
Semantic Community PortalSemantic Community Portal
An RDF Data Store 75
Semantic Community PortalSemantic Community Portal
Recap: The Recap: The Big Picture of Big Picture of
SWSW
An RDF Data Store 77
Future WorkFuture Work
• RDF schema-specific validator• Frame-based RDF schema-specific query
language• User interface• Automatic generation of community portals
– Application of digital library and archives
• Automatic generation of FAQs• Agent-Mediated B2B Electronic Commerce• Trust on the web
An RDF Data Store 78
SummarySummary
• RDF repository– RDF parser and generator using Prolog– RDF triples storage in Prolog and RDB tables– Application program interfaces – User interfaces (inference engine)
• Building community portals• Agent-based architecture• Trust on the Web