260 likes | 377 Views
Database Support for Semantic Web. Masoud Taghinezhad Omran taghinezhad@ce.sharif.edu Sharif University of Technology Computer Engineering Department Fall 2005. Outline. Introduction RDF storage in Relational Database RDF storage in OO Database Examples of Implementation
E N D
Database Support for Semantic Web Masoud Taghinezhad Omran taghinezhad@ce.sharif.edu Sharif University of Technology Computer Engineering Department Fall 2005
Outline • Introduction • RDF storage in Relational Database • RDF storage in OO Database • Examples of Implementation • Evaluation of Methods • References
Introduction • Basic ontology languages are influenced by RDF. • RDF has simple directed graph data model which is described by a set of triples. • Inferred statements from RDFS and ontology languages could be added. • So, It is important to select the best solution for storing and retrieving RDF information. • A common technique is using Relational Database.
RDF storage in Relational Database • First: How the table design should be for storing RDF triples? • Storage Methods: • Horizontal Table • Vertical Table • Horizontal Class • Table Per Property • Hybrid approach
Horizontal Table • Use one universal table in the database • Fields of the table are individual’s ID, the name of source class and the value of all properties. • Also it is possible to use a table to represent each ontology
Horizontal table (Benefits and Drawbacks) • Benefits: • Saving subject and predicate only once • Short query time • Simple structure • Drawbacks: • Large number of columns • Property value limits • Sparsity • Maintenance difficulty • Long load time
Vertical table • There is one universal table • Only three fields are in the table • Subject • Predicate • Object
Vertical table (Benefits and Drawbacks) • Benefits: • Very simple structure • Easy maintenance • Short load time • Constant column numbers • Drawbacks: • Long query time • Some queries are difficult • No database column type suitable for all literal values. So the value will be stored as string.
Horizontal class • Similar to Horizontal table approach but smaller • Uses a separate table for each class of the ontology • Every table contains fields for properties which have rdfs:domain value equal to representing class
Horizontal class (Benefits and Drawbacks) • Benefits: • Less sparsity • Short query time • Drawbacks: • Properties without explicit domain should be included in all tables.
Table per property • Uses one table for each property • Instances of all classes will be stored in the table for property “Type”
Table per property (Benefits and Drawbacks) • Benefits: • Short time for simple queries • Decrease in size of tables • Drawbacks: • Increase in number of tables • Complex queries are time consuming
Hybrid approach • Combines different approaches • Increase in efficiency than using each single approach • Decrease some limits and drawbacks of each single approach • Frequently used approach in implementations
RDF storage in Relational Database (Example) • DLDB Project: A knowledge base system that extends a relational database management system with additional capabilities for DAML+OIL inference. • Jena: A semantic web programmers’ toolkit
DLDB project: • A hybrid approach which combines property table and horizontal class approaches • For ontologies of moderate number of classes and simple queries this approach will have good performance • Uses Microsoft Access as relational database and FaCT as reasoner
DLDB project (cont.) • Capable of taxonomic inference using rdfs:subClassOf and rdfs:type and rdfs:subPropertyOf with views Example: The view defined for “student” class:
DLDB project (cont.) • Capable of computing class subsumption using a FaCT DL reasoner • First it computes the subsumptions and adds them to the model then creates class views.
Jena: • A hybrid approach which combines Horizontal table and vertical table approaches • Uses denormalized vertical table. Short literal values and resource URIs are stored directly in vertical tables and those exceed a threshold is stored in separate tables. • Jena has a mining tool that discovers patterns in RDF graph and RDF query log; So can suggest which properties to store together. example
Jena (Cont.) • By Jena we can develop application-specific Storage for RDF • Inferencing is also supported by Jena through inference graphs. Inferred statements will be stored in table.
Other RDF stores implemented with relational database • KAON • Parka Database • RDFSuite • Sesame and SAIL • TAP
RDF storage in object-oriented database • To support semantic interpretation, implementations on relational database will map the graph model onto storage structure. And in order to query the semantics the graph has to be constructed from triples. • Storing RDF data as a graph by OODB has advantages such as: • Storage design will be simplified because of storing graph directly. • Graph interpretation will be done without mapping • The relationship between RQL and OQL is used for query processing.
Querying RDF(S) • Querying the structure level • Triple data model is in this level • The best query language known is RDQL • Querying the semantic level • Graph data model is in this level • RQL is the first standardized query
Querying RDF(S) Example • Querying RDF data with RDQL • SELECT ?x WHERE (?x, <type>, <Document>) • SELECT ?x WHERE (?x, <type >, ?c1) , (?c2, <subClassOf>, <Document>) AND ?c1=?c2 • Querying RDF data with RQL • SELECT y FROM y type Document • SELECT $y FROM {:$y }. Type Document
OO-Store, RDF storage on OODB • Uses FastObject as object-oriented database system • A statement is created by the resource object referencing the value object using a property object
OO-Store vs. Sesame • The result of this approach was compared by result of sesame using different queries • It showed that OO-Store approach has much better performance
Refrences • V.Bonstrom, A.Hinze, H.Schweppe. “Storing RDF as a Graph” • A.Pan, J.Heflin. “DLDB: Estending Relational Database to Support Semantic Web Queries” • Oracle USA Inc. “RDF Support in Oracle” • K.Wilkinson, C.Sayers, H.Kuno, D.Reynolds, L.Ding. “Supporting Scalable, Persistent Semantic Web Application” • D.Becket, J.Grant. “Mapping Semantic Web Data With RDBMSes”