1 / 111

SWCLOS: A Semantic Web Processor on CLOS

SWCLOS: A Semantic Web Processor on CLOS. Seiji Koide National Institute of Informatics. SWCLOS Web Site. http://www-kasm.nii.ac.jp/~koide/SWCLOS2-en.htm For installing free Allegro Common Lisp Express, visit http://www.franz.com/downloads/

chyna
Download Presentation

SWCLOS: A Semantic Web Processor on CLOS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SWCLOS:A Semantic Web Processor on CLOS Seiji Koide National Institute of Informatics

  2. SWCLOS Web Site • http://www-kasm.nii.ac.jp/~koide/SWCLOS2-en.htm • For installing free Allegro Common Lisp Express, visit http://www.franz.com/downloads/ • For making mlisp image from Express version, visit http://www.franz.com/support/faq/index.lhtml#s3q13

  3. Objectives of This Tutorial • For CLOS Hacker • Provide an example of CLOS application • Enlighten CLOS Semantics in Semantic Web • For Lisper • Provide a tool for Semantic Web Processing

  4. What is SWCLOS? • Semantic Web Processor on top of CLOS • Processing Ontology in RDFS and OWL • Input Ontology in S-expression, RDF/XML, Triples • Output Ontology in S-expression , RDF/XML, Triples • An Amalgam of CLOS and RDFS/OWL • Pros • A tool for CLOS programmers for Semantic Web programming • Cons • Unavailable for C# and Java Programmers

  5. Agenda • Gentle Introduction of Semantic Web • RDF Graph • Introductory Example • RDF and RDFS Vocabulary and Semantics • rdf:type, rdfs:subClassOf • rdfs:domain, rdfs:range • rdfs:subPropertyOf • OWL Vocabulary and Semantics • Slot value restriction • Compound concepts • Advanced Talk • Semantics of RDF • Semantics of OWL • Reflection

  6. Semantic Web Layer-cake

  7. Semantic Web Layer-cake UNICODE Globally defined multi-language character sets Globally identify resources

  8. UNICODE at Allegro Common Lisphttp://www.franz.com/support/documentation/7.0/doc/iacl.htm Internally, all Lisp strings are represented as arrays of Unicode character codes. Each array element is exactly 16-bits wide, even if the string contains only 7-bit ASCII characters. This widening of strings causes a memory usage increase. However, since almost all initial Allegro CL strings are stored in memory-mapped files, the initial runtime memory usage difference between International Allegro CL and non-international Allegro CL is less than 5%.

  9. URI Library at Allegro Common Lisphttp://www.franz.com/support/documentation/7.0/doc/uri.htm URI stands for Universal Resource Identifier. For a description of URIs, see RFC2396, which can be found in several places, including the IETF web site (http://www.ietf.org/rfc/rfc2396.txt) and the UCI/ICS web site (http://www.ics.uci.edu/pub/ietf/uri/rfc2396.txt). We prefer the UCI/ICS one as it has more examples. URIs are a superset in functionality and syntax to URLs (Universal Resource Locators) and URNs (Universal Resource Names). That is, RFC2396 updates and merges RFC1738 and RFC1808 into a single syntax, called the URI. It does exclude some portions of RFC1738 that define specific syntax of individual URL schemes.

  10. Semantic Web Layer-cake Machine readable markup language Independent vocabulary in different NAMESPACE XML Schema Common Datatype

  11. Semantic Web Layer-cake Resource Description Framework

  12. Semantic Web Layer-cake Minimal set for ontology description

  13. Resource Description Framework • RDF Primer • http://www.w3.org/TR/rdf-primer/ • Concepts and Abstract Syntax • http://www.w3.org/TR/rdf-concepts/ • RDF/XML Syntax Specification • http://www.w3.org/TR/rdf-syntax-grammar/ • RDF Semantics • http://www.w3.org/TR/rdf-mt/ • RDF Vocabulary Description Language • http://www.w3.org/TR/rdf-schema/ • RDF Test Cases • http://www.w3.org/TR/rdf-testcases/

  14. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ Theoretical model in RDF is a labeled directed graph.

  15. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/

  16. Introductory Example (Pure CLOS) Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ superclass superclass superclass superclass class-of superclass class-of class-of

  17. Introductory Example (Pure CLOS) Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ (defpackage rdf (:documentation "http://www.w3.org/1999/02/22-rdf-syntax-ns")) (defpackage rdfs (:documentation "http://www.w3.org/2000/01/rdf-schema")) (defpackage eg (:documentation "http://somewhere-for-eg/eg")) (defpackage dc (:documentation "http://dublincore.org/2002/08/13/dces")) (defclass rdfs::Resource ( ) ((rdf::about :initarg :about))) (defclass eg::Work (rdfs::Resource) ( )) (defclass eg::Agent (rdfs::Resource) ( )) (defclass eg::Person (eg::Agent) ((eg::name :initarg :name))) (defclass eg::Document (eg::Work) ((eg::author :initarg :author :type eg::Person) (dc::title :initarg :title)))

  18. Introductory Example (Pure CLOS) Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ (defclass rdfs::Resource ( ) ((rdf::about :initarg :about))) (defclass eg::Work (rdfs::Resource) ( )) (defclass eg::Agent (rdfs::Resource) ( )) (defclass eg::Person (eg::Agent) ((eg::name :initarg :name))) (defclass eg::Document (eg::Work) ((eg::author :initarg :author :type eg::Person) (dc::title :initarg :title))) (setq eg::Proposal (make-instance 'eg::Document :author (make-instance 'eg::Person :name "Tim Berners-Lee") :title "Information Management: A Proposal" :about "http:/…/Proposal/")) (describe eg::Proposal) Bind to the Name Symbol Lisp Native Function

  19. Case Sensitive Lisp or Modern Lisp ACL8.1 or 8.0 in Windows Start  Program  Allegro CL  Modern ACL Images  Allegro CL (w IDE, Modern) DO NOT SELECT ANSI image IN WINDOW SWCLOS requires Case Sensitive Mode of ACL.

  20. SWCLOS Web Site • http://www-kasm.nii.ac.jp/~koide/SWCLOS2-en.htm • For installing free Allegro Common Lisp Express, visit http://www.franz.com/downloads/ • For making mlisp image from Express version, visit http://www.franz.com/support/faq/index.lhtml#s3q13

  21. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ <http://somewhere-for-eg/eg#Work> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2000/01/rdf-schema#Resource> . eg:Work rdfs:subClassOf rdfs:Resource .

  22. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource .

  23. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource .

  24. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property .

  25. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document .

  26. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document . eg:author rdfs:range eg:Person .

  27. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document . eg:author rdfs:range eg:Person . http:/.../Proposal/ eg:author _:a01 .

  28. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document . eg:author rdfs:range eg:Person . http:/.../Proposal/ eg:author _:a01 . _:a01 rdf:type eg:Person .

  29. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document . eg:author rdfs:range eg:Person . http:/.../Proposal/ eg:author _:a01 . _:a01 rdf:type eg:Person . _:a01 eg:name "Tim Berners-Lee" .

  30. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Work rdfs:subClassOf rdfs:Resource . eg:Agent rdfs:subClassOf rdfs:Resource . eg:author rdf:type rdf:Property . eg:author rdfs:domain eg:Document . eg:author rdfs:range eg:Person . http:/.../Proposal/ eg:author _:a01 . _:a01 rdf:type eg:Person . _:a01 eg:name "Tim Berners-Lee" . http:/.../Proposal/ dc:title "Information Management: A Proposal" .

  31. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/

  32. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/

  33. Introductory Example (SWCLOS)Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ Already defined in SWCLOS (in-package gx-user) rdfs:Resource  #<rdfs:Class rdfs:Resource> (defpackage eg (:documentation "http://somewhere-for-eg/eg")) (defpackage dc (:documentation "http://dublincore.org/2002/08/13/dces")) (defResource eg::Work (rdfs:subClassOf rdfs:Resource)) (defResource eg::Agent (rdfs:subClassOf rdfs:Resource)) (defResource eg::Person (rdfs:subClassOf eg:Agent)) (defResource eg::Document (rdfs:subClassOf eg:Work)) (defProperty eg::author (rdfs:domain eg:Document) (rdfs:range eg:Person)) Double colons needed only at first Single colon accepted secondly and after

  34. Introductory Example (SWCLOS)Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ rdfs:domain directs a class where the slot definition is attached. rdfs:range denotes a class of slot value. (defProperty eg::name (rdfs:domain eg:Person) (rdfs:range rdfs:Literal)) (defProperty dc::title (rdfs:domain eg:Document) (rdfs:range rdfs:Literal)) (defIndividual eg::Proposal (rdf:type eg::Document) (eg:author (eg:Person (eg:name "Tim Berners-Lee"))) (dc:title "Information Management: A Proposal") (rdf:about "http:/…/Proposal/")) A bnode is automatically created on demand.

  35. Introductory Example Obsolete RDFS Documenthttp://www.w3.org/TR/2002/WD-rdf-schema-20021112/ eg:Person  eg:author  eg:Proposal  (describe eg:Proposal)  (get-form eg:Proposal)  (write-xml eg:Proposal) (-> eg:Proposal dc:title)  (-> eg:Proposal eg:author eg:name)  (-> eg:Proposal eg:author rdf:type)  The RDF/XML form of eg:Proposal is printed. Start from 1st parameter and travel the graph along with the path

  36. RDF Vocabulary Description Language 1.0: RDF Schema W3C Recommendation 10 February 2004  RDF Classes

  37. RDF Vocabulary Description Language 1.0: RDF Schema W3C Recommendation 10 February 2004  RDF Properties

  38. Entailment Ruleshttp://www.w3.org/TR/rdf-mt/

  39. Entailment Ruleshttp://www.w3.org/TR/rdf-mt/ Subsumption Rule Transitivity Rule (defclass xxx ( ) ( ) ) (setq vvv (make-instance (defclass uuu (xxx) ( )))) (typep vvv xxx)  true (defclass xxx ( ) ( )) (defclass vvv (xxx) ( )) (defclass uuu (vvv) ( )) (subtypep 'uuu 'xxx)  true

  40. Subsumption rule in Wine Ontology (RDFS) rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource WineDescriptor WineColor PotableLiquid Wine Zinfandel rdf:Property Red Winery rdfs:range rdfs:domain hasColor rdfs:range rdfs:domain Elyse rdfs:domain hasMaker rdfs:domain rdfs:range rdfs:range ElyseZinfandel hasMaker rdfs:domain rdfs:range rdfs:range rdfs:domain hasWineDescriptor hasColor

  41. Subsumption rule in Wine Ontology (RDFS) Transition rule of rdfs:subClassOf rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource PotableLiquid PotableLiquid Wine Wine Zinfandel Zinfandel rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range (defTriple vin:Wine rdfs:subClassOf food:PotableLiquid) Rdfs rule 11 (subtypep vin:Zinfandel food:PotableLiquid)  t (defTriple vin:Zinfandel rdfs:subClassOf vin:Wine)

  42. Subsumption rule in Wine Ontology (RDFS) Subsumption rule rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource PotableLiquid PotableLiquid Wine Wine Zinfandel Zinfandel rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range ElyseZinfandel ElyseZinfandel (defTriple vin:Wine rdfs:subClassOf food:PotableLiquid) Rdfs rule 9 (typep vin:ElyseZinfandel food:PotableLiquid)  t (defTriple vin:Zinfandel rdfs:subClassOf vin:Wine) (defTriple vin:ElyseZinfandel rdf:type vin:Zinfandel)

  43. Summary of Introduction • Case sensitive lisp • A QName is represented as an exported lisp symbol. • Namespace is realized by using lisp package. • A resource of RDF is created as a CLOS object, and bound to the QName. • rdf:type to class-of (type-of) mapping • rdfs:subClassOf to superclass mapping • Define Macro defResource, defIndividual, and defProperty

  44. Entailment Ruleshttp://www.w3.org/TR/rdf-mt/ Domain Entailment Range Entailment

  45. Entailment Ruleshttp://www.w3.org/TR/rdf-mt/

  46. Domain & Range in Wine Ontology (RDFS) rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource WineDescriptor WineColor PotableLiquid Wine Zinfandel rdf:Property Red Winery rdfs:range rdfs:domain hasColor rdfs:range rdfs:domain Elyse rdfs:domain hasMaker rdfs:domain rdfs:range rdfs:range ElyseZinfandel hasMaker rdfs:domain rdfs:range rdfs:range rdfs:domain hasWineDescriptor hasColor rdfs:domain: classes that are reachable from a subject node with an path of rdf:typerdfs:subClassOf rdfs:range: classes that are reachable from a object node with an path of rdf:typerdfs:subClassOf

  47. Domain & Range in Wine Ontology (RDFS) Extension rule of rdfs:domain rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource PotableLiquid PotableLiquid Wine Wine rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range rdfs:domain hasColor hasColor (defTriple vin:hasColor rdfs:domain vin:Wine) Ext rule 1 (domainp vin:hasColor food:PotableLiquid) t

  48. Domain & Range in Wine Ontology (RDFS) Extension rule of rdfs:range rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource WineColor PotableLiquid Wine rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range rdfs:domain rdfs:range hasColor (defTriple vin:hasColor rdfs:range vin:WineColor) (defTriple vin:WineColor rdfs:subClassOf vin:WineDescriptor)

  49. Domain & Range in Wine Ontology (RDFS) Extension rule of rdfs:range rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class WineColor rdfs:Resource WineDescriptor WineDescriptor WineColor PotableLiquid Wine rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range rdfs:domain rdfs:range hasColor hasColor (defTriple vin:hasColor rdfs:range vin:WineColor) Ext rule 2 (rangep vin:hasColor vin:WineDescriptor)  t (defTriple vin:WineColor rdfs:subClassOf vin:WineDescriptor)

  50. Domain & Range in Wine Ontology (RDFS) Inheritance by rdfs:subPropertyOf rdfs:subClassOf rdfs:subPropertyOf rdf:type class instance rdfs:Class rdfs:Resource WineDescriptor PotableLiquid PotableLiquid Wine Wine rdf:Property rdfs:range rdfs:domain rdfs:range rdfs:domain rdfs:domain rdfs:range rdfs:range rdfs:domain hasWineDescriptor hasWineDescriptor hasColor hasColor (defTriple vin:hasWineDescriptor rdfs:domain vin:Wine) Ext rule 3 (domainp vin:hasColor food:PotableLiquid) t (defTriple vin:hasWineDescriptor rdfs:range vin:WineDescriptor) (defTriple vin:hasColor rdfs:subPropertyOf vin:hasWineDescriptor)

More Related