The graphbased data model: - PowerPoint PPT Presentation


PPT – The graphbased data model: PowerPoint presentation | free to view - id: 5c5ae-ZDc1Z


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

The graphbased data model:


6. Using graphs to ... The Java-based Jena package from HP Labs allows users to ... SparQL is implemented in Jena through the ARQ package, and ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 52
Provided by: dgr52


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: The graphbased data model:

  • The graph-based data model
  • Storing and manipulating data in
  • distributed graphs
  • (Using RDF and Jena to put the
  • SparQL in your smile, and the
  • Twinkle in your eye
  • and D2R too)
  • Michael Grobe
  • Biomedical Applications Group
  • Research Technologies
  • University Information Technology Services
  • Indiana University

  • This presentation in perspective
  • This is actually one of a series of presentations
    on Linked Data Web and graph database
  • Introduction to ontologies
  • This presentation on RDF, Jena, SparQL, etc
  • OWL and inference over ontologies
  • Using graph technologies in bioinformatics
  • In general, these topics appear simple, but are
    fraught with complications, limitations, and
    qualificationsespecially when the casual user
    attempts to compare them with relational data
    approaches to the same or similar problems.
  • In addition, this is a pretty big elephant
    surrounded by a lot of blind men.
  • As a result, this presentation is a survey of
    concrete examples of basic components used to
    manipulate data using stored as graphs, or
    appearing to have been stored in graphs. It
    will use the Gene Ontology for some of these

  • Table of Contents
  • Using graphs to represent data
  • Using RDF to represent graphs
  • Jena a Java class library for manipulating RDF
  • Using SparQL graph templates to query RDF
  • Using Twinkle to make SparQL queries
  • Using iSPARQL graphical graph templates to query
  • Exposing relational data as RDF
  • Thinking of SparQL queries as SQL
  • Table of Non-contents
  • OWL and inference over ontologies
  • Using the Semantic Web in bioinformatics research

  • Using graphs used to represent data
  • Here are 2 graphs that represent 2 kinds of
    information associated with 4 different persons.
  • Graph 1 Person ages Graph 2
    Favorite Friends

  • Using graphs to represent data
  • Here the 2 graphs are combined using named edges
    to represent 2 kinds of information associated
    with the same 4 persons.
  • Graph 3 Person ages (age) and favorite friends
  • Read these links as Smith has age 21 or Jones
    has favorite friend Smith to make them more
    sentence-like. Each arc is like the
    predicate of a sentence, connecting a subject
    with an object. (Note that a subject may have
    gt 0 arcs of each type.)

  • Using graphs to represent data
  • Data is sometimes represented using so-called
    blank nodes to help cluster attributes
  • Graph 4 Blank nodes linking a name, an age,
    and a favorite friend via arcs named name,
    age, and fav, as follows
  • Blank nodes are useful for specifying lists of
    items, but are discouraged within the Semantic
    Web. Use (dereferenceable) URIs (like
    http// whenever possible.

  • Using URIs and URLs to represent data
  • Now if it hadnt already happened someone could
    come up with the idea to use URLs to point to Web
    documents that describe the exact meaning of
    each edge.
  • For example, some popular magazine could publish
    their definition of favorite friend on a page
  • http//
  • and other documents could define BFF,
    long-time-friend, family-friend, etc, And, in
    fact, these definitions could themselves refer to
    other definitions like some superset of
    relationships such as
  • http//
  • or the personal_relationships file, itself, could
    include a collection of definitions, including
    favorite friend, or fav, that we might refer
    to as
  • http//
  • using the convention for targeting a specific
    location within a URL.
  • Of course, for a lot of applications this would
    all be unnecessary some URI could just be used
    to indicate an edge type known to the file

  • Using RDF-XML to serialize graphs
  • Graphs can be serialized or represented in a
    textual format. When graphs are serialized, each
    connection is represented by 3 components, a
    so-called RDF triple. Each triple is composed
    of a subject, predicate and object where
    each edge between each pair of entities becomes a
    named predicate.
  • Each subject is represented as
  • - a blank node, such as _2,
  • - a literal value, such as valuetype where
    type is some URI,
  • that defines a data type, as in 21age, or
  • - a URI, like http//
  • Each object is represented as
  • - a blank node
  • - a literal value, or
  • - a URI
  • Each predicate is represented as
  • - a URI, like http//
    fav, or an
  • abbreviated URI like exampleage which
    represents a URI that will
  • be expanded by substituting a value for the
    stringexample. If the

  • Graph 3 as a set of 12 triples (3 for each
  • -------------------------------------
  • Subject Predicate Object
  • Blake examplefav Blake
  • Blake exampleage "12"
  • Blake examplename "Blake"
  • Jones examplefav Smith
  • Jones exampleage "35"
  • Jones examplename "Jones"
  • George examplefav Smith
  • George exampleage "21"
  • George examplename "George"
  • Smith examplefav Jones
  • Smith exampleage "21"

  • Two ways to represent the Graph 3 triples using
  • Properties encoded as XML entities
  • ltrdfRDF      xmlnsrdf"http//
    2/22-rdf-syntax-ns"      xmlnsexample"http//f"gt      ltexamplePer
  • ltexamplenamegtSmithlt/examplenamegt
  • ltexamplefavgtJoneslt/examplegt     lt/examplePer
    songt           lt/rdfRDFgt
  • Properties encoded as XML attributes
  • ltrdfRDF      xmlnsrdf"http//
    2/22-rdf-syntax-ns"      xmlnsexample"http//f"gt      ltrdfDescrip
    tion  examplenameSmith           
  • examplefavJones
         lt/rdfDescriptiongt           lt/rdfRDFgt

  • Representing URIs
  • In work with RDF you will see URIs abbreviated in
    several ways, using namespace, PREFIX and ENTITY
    definitions, depending on the context
  • xmlnslibhttp//
  • or
  • PREFIX ltlibhttp//
  • or
  • !ENTITY lib http//
  • If the namespace abbreviations in the entities
    example above get expanded, then Smith is
    actually being represented as
  • ltrdfRDF      xmlnsrdf"http//
    2/22-rdf-syntax-ns"      lthttp//
  • lthttp//
  • Smith
  • lt/http//
  • lthttp//
  • 21

  • Graph 3 using resources to represent each
  • Persons are modeled as resources by replacing
    the strings for each node identifier with URIs
  • ----------------------------------------------
  • Subject Predicate

  • lthttp// examplefav
  • lthttp// exampleage
  • lthttp//
    examplename "Blake"

  • lthttp// examplefav
  • lthttp// exampleage
  • lthttp//
    examplename "Jones"

  • lthttp// examplefav
  • lthttp// exampleage
  • lthttp//
    examplename "George"

  • Representing entries in Graph 3 as resources
  • Format 1
  • ltrdfRDF    xmlnsrdf"http//
    22-rdf-syntax-ns"    xmlnsexample"http//fake."gt    ltexamplePerson
  •        ltexamplenamegtSmithlt/examplenamegt
  • ltexamplefav rdfresourcehttp//
    .edu/jones /gt   lt/examplePersongt          
  • - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - -
  • Format 2
  • ltrdfRDF    xmlnsrdf"http//
    22-rdf-syntax-ns"    xmlnsexample"http//fake."gt    ltrdfDescription
  • examplenameSmith
    exampleage21 /gt
  • ltexamplefav rdfresourcehttp//
    edu/jones /gt   lt/rdfDescriptiongt          
  • Note that the resource URI references in this
    example are not real documents they are not

  • A person record using FOAF (from Obitko)
  • ltrdfRDF xmlnsrdf"http//
  • xmlnsfoaf"http//
  • xmlns"http//
  • ltfoafPerson rdfabout "http//
  • ltfoafmbox rdfresource"mailtojoe.smith"/gt
  • ltfoafhomepage rdfresource"http//www.e"/gt
  • ltfoaffamily_namegtSmithlt/foaffamily_name
  • ltfoafgivennamegtJoelt/foafgivennamegt
  • lt/foafPersongt
  • lt/rdfRDFgt

  • RDF summary and implications for the Semantic Web
  • A graph may be represented as a collection of
  • RDF-XML representations of graphs will contain
    URIs that
  • - serve to identify and/or reference syntactic
    elements (they define
  • tag names), and
  • - identify and/or name resources subjects,
    predicates and/or objects.
  • Such URIs may be imaginary or provide addresses
    of actual, dereferenceable, web documents, in
    possibly remote locations.
  • This can result in a Gigantic Global Graph,
    usually know as the Linked Data Web or the
    Semantic Web, with RDF as one of W3Cs Semantic
    Web architectural levels.
  • If HTML and the Web make all online documents
    look like one huge book, RDF, schema, and
    inference languages will make all the data in the
    world look like on huge database. TimBL
  • Editors note Here TimBL is using the term
    schema to refer to an RDF schema that defines
    RDF triples much more loosely than a relational
    database schema defines a collection of tables in
    a database.

  • RDF graphs may be interrogated
  • - by physical inspection (for anyone willing to
    read XML)
  • - by writing programs that read RDF files,
    construct the
  • represented graphs internally, and then
  • - access graph triples in sequential order,
  • - select triples according to specified content,
  • - apply SparQL queries and access results in
    sequential order
  • - using command-line tools that apply SparQL
  • - using GUI interfaces accepting SparQL queries
  • - written in text, or
  • - represented graphically
  • - via URLs carrying form data, or SOAP requests
    to SparQL endpoints

  • How to query an RDF graph using Jena
  • The Java-based Jena package from HP Labs allows
    users to manipulate and query graphs, and
    import/export RDF, etc.
  • You can write a program that uses Jena classes to
  • - retrieve and parse an RDF file containing a
    graph or a
  • collection of graphs,
  • - store it in memory, and then
  • - examine each triple in turn, examine one
    component (say,
  • the subject) of each triple in turn, or
    examine only triples that
  • meet specified criteria.
  • For example, one might examine each stored triple
    searching for a specific reference URI, or for a
    specific literal value.
  • One might look for persons of a specific age,
    21xsdage, in the object portion of each
  • Jena also provides support for inference using
    rule sets and for querying via SparQL.

  • Jena example
  • In JENA, RDF nodes can have type Resource, URI
    Resource, literal, or anonymous (slight
    extension to standard RDF).
  • A Jena model is created by a factory
  • Model m ModelFactory.createDefaultModel()
  • A Jena ontological model is a model along with a
  • OntModel m ModelFactory.createOntologyModel()
  • Jena can
  • - read in an RDF serialized graph (from a
    file, URL, etc.)
  • - write a serialized model to a file or STDOT,
  • - perform standard operations on the model.
    For example, given the
  • populated models m and n, Jena can then do
  • Model x m.add( n ) // Union

  • Reading and writing a model in Jena
  • String input FIleName Some-GO-entries-diddled.r
  • Model m ModelFactory.createDefaultModel()
  • InputStream in FileManager.get().open(
    inputFileName )
  • if( in null )
  • throw new IllegalArgumentException( File not
    found.\n )
  • in, ) // Treat blank lines as
  • model.write( System.out , N-tripleRDF/XML
  • //which will yield a file of N-triple,
    RDF/XML, or XML-ABBREV records.

  • Cannonical process to examine each triple in a
  • stmtIterator iterator model.listStatements()
    // Statements composed of triples
  • while( iterator.hasNext() )
  • Statement statement iterator.nextStatement(
  • Resource subject statement.getSubject()
  • Property predicate statement.getPredicate()
  • // Get the object, which in this example, may
    be a Resource or just a string, so
  • // it is kept in an RDFNode, a superclass of
    Resource and literal.
  • RDFNode object statement.getObject() //
    superclass of Resource and literal
  • // Now process the object here it is just
  • System.out.print( subject.toString() )
  • System.out.print( predicate.toString()
  • if( object instanceof Resource )
  • // its a resource.
  • System.out.print(
    object.toString() )

  • Statement iterators for accessing selected
  • There are several methods for creating iterators
    over a model
  • - Some simply list the components of each
  • - model.listSubjects()
  • - model.listObjects()
  • - Some compare a specific component with a
    specified value, as in
  • model.listSubjectsWithProperty( Prop p, RDFNode
  • (which will get you a
    collection of subjects possessing
  • property/predicate p and specific value o)
  • - Some compare all components against specific
    values in 2 steps
  • - define a selector possessing specific values
    s, p and o,
  • where null or (RDFNode) null matches
  • Selector selector new SimpleSelector(

  • predicate, object )

  • SparQL a graph-based query language
  • Sparql is a language that lets users query RDF
    graphs . . . using graph patterns (written in N3)
    containing variables.
  • The query engine will return an exhaustive list
    of triples that satisfy each query through value
    substitution. (aka query by example, QBE).
  • This process is not always intuitive, and/or SQL
    has perverted the minds of a generation of
    programmers (J. Random Guy somewhere on the
  • SparQL is implemented in Jena through the ARQ
    package, and queries may be made from within Java
    scripts (McCarthy, 2005), or via a SparQL client
    distributed with Jena. The process to make a
    query is
  • - build a query in a .rq file, and
  • - execute the query using
  • sparql query filename.rq
  • or
  • sparql.bat query filename.rq
  • SparQL does not do inference (except when used
    within Jena against an ontological model).

  • A SparQL example
  • This SparQL example query simply asks for a list
    of the first 10 triples in the file specified in
    the FROM clause
  • rdf lthttp//
  • PREFIX example lthttp//
  • select s o
  • from lthttp//kongo.uits.iupui.edu8546/rdf-example
  • where
  • s p o .
  • LIMIT 10
  • s, p, and o are variable names that will each
    be assigned a value as the query is satisified.
    Variable names may also start with ?.

  • SparQL a graph-based query language
  • The basic, partial syntax of a SparQL query is
    based on N3(/turtle) and similar to
  • BASE ltsome URI from which relative FROM and
    PREFIX entries will be offsetgt
  • PREFIX prefix_abbreviation lt some_URI gt
  • SELECT some_variable_list
  • FROM ltsome_RDF_source gt
  • some_triple_pattern . .
  • Notes
  • - the lt and gt characters are required
  • - the BASE and PREFIX entries are optional and
    BASE applies to relative

  • Querying Graph 3 format 1 using SparQL
  • Heres a reminder of one of the representations
    used to store of Graph 3 here stored in a file
    named rdf-example-1.rdf
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltrdfRDF
  • xmlnsrdf"http//
  • xmlnsexample"http//
  • gt
  • ltexamplePerson rdfabout"http//
  • ltexamplenamegtSmithlt/examplenamegt
  • ltexampleagegt21lt/exampleagegt
  • ltexamplefav rdfresource"http//
    /jones" /gt
  • lt/examplePersongt
  • lt/rdfRDFgt

  • A SparQL query against the first data
  • C\Jena-2.5.7\Jena-2.5.7\batgt cat
  • PREFIX rdf lthttp//
  • PREFIX example lthttp//
  • select
  • from lthttp//kongo.uits.iupui.edu8546/smiht-forma
  • where
  • s p o .
  • C\Jena-2.5.7\Jena-2.5.7\batgt sparql.bat --query
  • --------------------------------------------------
  • s p o

  • lthttp// examplefav
  • lthttp// exampleage

  • Querying Graph 3 format 2 using Sparql
  • Heres a reminder of the other representation of
    Graph 3 stored in a file named
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltrdfRDF
  • xmlnsrdf"http//
  • xmlnsexample"http//
  • gt
  • ltexamplePerson rdfabout"http//
  • examplenameSmith
  • exampleage21 /gt
  • ltexamplefav rdfresource"http//
    u/jones" /gt
  • lt/examplePersongt
  • lt/rdfRDFgt

  • The same SparQL query against the second data
  • C\Jena-2.5.7\Jena-2.5.7\batgt cat
  • PREFIX rdf lthttp//
  • PREFIX example lthttp//
  • select
  • from lthttp//kongo.uits.iupui.edu8546/smith-forma
  • where
  • s p o .
  • C\Jena-2.5.7\Jena-2.5.7\batgt sparql.bat --query
  • --------------------------------------------------
  • s p

  • lthttp// examplefav
  • lthttp// exampleage

  • A distributed SparQL query against 4 separate
    RDF files
  • The next query searches 4 dereferenceable files
    holding live data in the first representation
    format above
  • C\Jena-2.5.7\Jena-2.5.7\batgt cat
  • PREFIX rdf lthttp//
  • PREFIX example lthttp//
  • select
  • from lthttp//kongo.uits.iupui.edu8546/smithgt
  • from lthttp//kongo.uits.iupui.edu8546/jonesgt
  • from lthttp//kongo.uits.iupui.edu8546/georgegt
  • from lthttp//kongo.uits.iupui.edu8546/blakegt
  • where
  • s p o .

  • Results of the distributed SparQL query
  • C\Jena-2.5.7\Jena-2.5.7\batgt sparql.bat --query
  • --------------------------------------------------
  • s p

  • lthttp//
    examplefav lthttp//
  • lthttp//
    exampleage "12"
  • lthttp//
    examplename "Blake"
  • lthttp// rdftype
  • lthttp//
    examplefav lthttp//
  • lthttp//
    exampleage "35"
  • lthttp//
    examplename "Jones"
  • lthttp// rdftype
  • lthttp//
    examplefav lthttp//
  • lthttp//
    exampleage "21"
  • lthttp//
    examplename "George"
  • lthttp// rdftype


The magic of ontologies There are many
defintions of ontology, but in very general
terms, an ontology may be thought of as a
taxonomy of objects (or concepts) based on a
particular relationship between pairs of those
objects (or concepts). A common example of a
taxonomy is an evolutionary tree in which
individual species are related on the basis of
evolutionary descent. That is, one species of
each pair connected by an edge descended from the
other. (Actually, its the members of the
species who evolve, but . . .) Within such
structures no member is considered to have
descended from more than one immediate species.
Within an ontology, however, an object or
concept may have more than one immediate
parent, and no circular sub-graphs are allowed,
so the resulting structure is a Directed Acyclic
Graph (DAG). An ontology can be represented by
a special RDF graph It is special in that
the predicates convey transitivity if A is a
descendant of B, and B is a descendant of C, then
A is a descendant of C. IS_A and PART_OF
relationships are commonly used to build

Here is a portion of the GO is_a DAG
(Ashburner, 2004) for molecular function
(example chromatin binding is_a DNA
binding) (Note that this diagram
shows some genes, but the Gene Ontology is
actually a taxonomy of terms that can be used to
describe or annotate genes, rather than a
taxonomy of genes. )
  • Heres the first entry (of the 26K) in the GO
    text version (with all three parts intermixed)
  • Term
  • id GO0000001
  • name mitochondrion inheritance
  • namespace biological_process
  • def "The distribution of mitochondria, including
    the mitochondrial genome, into daughter cells
    after mitosis or meiosis, mediated by
    interactions between mitochondria and the
    cytoskeleton." GOCmcc, PMID10873824,
  • synonym "mitochondrial inheritance" EXACT
  • is_a GO0048308 ! organelle inheritance
  • is_a GO0048311 ! mitochondrion distribution
  • You can also get the GO as RDF XML, or as a MySQL
    database. A portion of the molecular function
    extract on the previous page is shown in RDF XML
    on next page

  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltrdfRDF xmlnsrdf"http//
    df-syntax-ns" xmlnsgo"http//www.geneontology.o
  • ltgoterm rdfabout"http//
    goall"gt (Note all is like root.)
  • ltgoaccessiongtalllt/goaccessiongt
  • ltgonamegtalllt/gonamegt
  • ltgodefinitiongtThis term is the most general
    term possiblelt/godefinitiongt
  • lt/gotermgt
  • ltgoterm rdfabout"http//
  • ltgoaccessiongtGO0003674lt/goaccessiongt
  • ltgonamegtmolecular_functionlt/gonamegt
  • ltgosynonymgtGO0005554lt/gosynonymgt
  • ltgosynonymgtmolecular functionlt/gosynonymgt
  • ltgodefinitiongtElemental activities, such as
    catalysis or binding, describing the actions of a
    gene product at the molecular level. A given gene
    product may exhibit one or more molecular
  • ltgois_a rdfresource"http//www.geneontology
    .org/goall" /gt
  • lt/gotermgt
  • lt/rdfRDFgt

  • Find parents of GO0004003 in the example GO
  • PREFIX xsd lthttp//
  • PREFIX rdf lthttp//
  • PREFIX go lthttp//
  • select
  • from lthttp//discern.uits.iu.edu8421/Some-GO-entr
  • diddled.rdfgt
  • where
  • lthttp//
    gois_a parent .
  • Result
  • C\Jena-2.5.7\batgt sparql.bat --query
  • -----------------------------------------------
  • parent

  • Find all 3-element paths up from GO0004003
  • PREFIX go lthttp//
  • select
  • from
  • lthttp//discern.uits.iu.edu8421/Some-GO-entries
  • where
  • lthttp//
    gois_a a .
  • a gois_a b .
  • b gois_a c .
  • Note that given a table showing the GO DAG, you
    can get this result within SQL using multiple
    joins, but you cant find N-element paths in
    either language (unless you use inference within

  • Find all 3-element paths up from GO0004003 using

  • Query dbpedia for entries about Goethe
  • (using Virtuoso iSparql text query)
  • Note that the predicate bifcontains is a
    Virtuoso Built-In Function that searches
    back-end text indexes. It might be possible to
    search using a standard SparQL regex FILTER, but
    it would be much slower.

  • The same query using the iSparql graphical QBE
  • Here is the same query in graphical form as
    constructed using the iSparql QBE interface
  • Components can be dragged-and-dropped from the
    menu at the top of the window. The whole
    interactive window is shown on the next page.

  • The same query within the whole iSparql QBE window

  • Results from the iSparql text and/or QBE queries

  • Possible applications for ontologies
  • Suppose provides a list of 89K
    proteins, their mappings to NCBI Gene IDs, and
    their GO annotations (which it does), and perhaps
    a small subset looks like
  • XXX GO00003682
  • YYY GO00003682
  • ZZZ GO00008026
  • AAA GO00008096
  • And suppose links GO IDs with GO category
    names, which it does,
  • And suppose I have a list of researchers and
    their various areas of interest, like
  • Smith studies gene XXX
  • Jones studies nucleic acid binding
  • etc.
  • Then . . . what kinds of questions can I ask that
    would have been difficult before, like

  • Optional clauses in SparQL queries
  • SparQL has more features than presented so far.
  • Here are some clauses permitted following the
    where clause
  • order by DESCASC ( variable_list )
  • limit n print up to n return values.
  • offset n start output with the nth return value.

  • Optional clauses in SparQL queries
  • Permitted within where clauses
  • FILTER restricts variable matches in the
    preceding triple to specified filter patterns, as
  • s p date FILTER ( date gt
    "2005-01-01T000000Z"xsddateTime )
  • or
  • s p d FILTER
  • ( xsddateTime( d ) lt
    xsddateTime( "2005-01-01T000000Z ) )
  • or
  • ?s ?p ?name FILTER regex( ?name,
    "smi", some_flag )
  • UNION where clauses may be constructed as
  • triple_pattern_1 UNION

  • A relational view of the Semantic Web (Newman,
  • Relaxing certain requirements normally imposed
    upon SQL (specifically type contraints on joined
    fields), there are strong similarities among
    operations applied to relational and graph-based
    models. For example
  • - triple_pattern . triple_pattern
  • approximates an untyped join, as demonstrated
    on the next slide
  • - filter
  • approximates an SQL conditional
  • - union
  • approximates an outer union
  • - optional
  • approximates a left outer join( R, S ), which
  • ? join( R, S ) unioned with an anti-join( R, S),
    where an anti-join
  • ? difference with a semi-join, and a semi-join
  • ? join and a projection.

  • A relational view of the Semantic Web (Newman,
  • Here we look at the triple pattern used to find
    the 3 hop paths towards the GO root node,
  • select a, b, c where
  • lthttp//
  • gois_a a .
  • a gois_a b .
  • b gois_a c .
  • Which is roughly equivalent to the following SQL
  • select
  • a.parent_id, b.parent_id, c.parent_id
  • from
  • GO.molecular_function_DAG a
  • join
  • GO.molecular_function_DAG b

  • Publishing relational data as virtual RDF
  • So far we have accessed RDF presented mostly from
    free-standing files. However, legacy relational
    databases can be published as RDF stores on the
    Semantic Web by using gateways like D2R and
    Virtuoso (commercial).
  • The D2R approach requires 2 steps
  • - interrogate the database via JDBC using
    generate-mapping to build a configuration
    (mapping) file from the relational table
    definitions, and then
  • - start the D2R server with the mapping file.
  • Notes
  • - Each table row becomes a separate
  • - Primary keys (if any) become resource
    identifiers, and
  • - rows in linked tables identified by foreign
    keys may be
  • merged into the entity (?).
  • The D2R utility dump-rdf can also convert an
    entire table into RDF form for access in a single
    SparQL query.

  • Accessing data via a SparQL Endpoint
  • Since the D2R server makes a SparQL endpoint
    available, one can execute queries via HTTP
    requests like
  • http//kongo.uits.iupui.edu6700/sparql?query
  • select ?s ?p ?o where ?s ?p ?o .
    limit 10
  • The D2R server also provides a Web form that can
    be used to interrogate its content using SparQL.
    This interface is based on an AJAX component
    called SNORQL, and available at
  • http//kongo.uits.iupui.edu6700/sparql
  • The D2R server also provides an interface for
    users to browse its backend data. To use it you
    just Web in to
  • http//kongo.uits.iupui.edu6700

  • Portion of a D2R-server mapping file for CLSD
  • _at_prefix map ltfile/C/d2r-server-0.4/mapping-clsd
    2-GO-DGN.n3gt .
  • _at_prefix d2rq lthttp//
    /bizer/D2RQ/0.1gt .
  • mapdatabase a d2rqDatabase
  • d2rqjdbcDriver ""
  • d2rqjdbcDSN "jdbcdb2//libra45.uits.iu.edu5000
  • d2rqusername account"
  • d2rqpassword password"
  • .
  • mapDISEASE_GENE_NET_GENES a d2rqClassMap
  • d2rqdataStorage mapdatabase
  • d2rquriPattern "DISEASE_GENE_NET.GENES/_at__at_DISEASE
  • d2rqclass vocabDISEASE_GENE_NET_GENES
  • .
  • mapDISEASE_GENE_NET_GENES__label a
  • d2rqbelongsToClassMap mapDISEASE_GENE_NET_GENES

  • Triple stores
  • There exist so-called triple stores that can
    use backend data storage engines, like MySQL, to
    house RDF data, and process queries.
  • For example, Sesame is a triple store that can
    use serveral different kinds of backends DBMS
    (originally PostgreSQL), simple RDF files, and/or
    other, network-accessed triple stores, like
    Sesame itself.
  • Sesame also demonstrates a generic architecture
    for RDF and RDFS storage and query processing,
    and does not require keeping the whole graph in
    memory, when processing requests.
  • Jena can also employ back-end data base
    management systems.
  • There are also some graph based data management
    systems, like Neo4j, that can be used to store
    raw graph structured data. In fact, Neo4j has at
    least one overlay product that uses Neo4j to
    manage RDF.
  • Neo4j may work well for data collections running
    into the billions of nodes, since it does not
    require its whole graph to be memory-contained
    (although it works better with larger memory),
    and is quite fast. .

  • References
  • Ashburner, M., et al., Gene ontology a tool for
    the unification of biology, Nature Genetics,
  • Berners-Lee, Tim, Linked Data, 2006.
  • Bizer, Chris, The D2RQ Plattform - Treating
    Non-RDF Databases as Virtual RDF Graphs,
  • Bizer, Chris, Richard Cyganiak, Tom Heath, How
    to Publish Linked Data on the Web, 2007.
  • http//
  • Cygniak, Richard, A Relational Algebra for
    SPARQL, HP Labs, 2005.
  • http//
  • Davis, Ian, An Introduction to RDF,
  • Dodds, Leigh, Introducing SparQL Querying the
    Semantic Web, 2005. http//
  • McBride, Brian, An Introduction to RDF and the
    Jena RDF API , 2007. http//