Tim; A bit more on this that you may find useful. First, named
graphs, in the sense that N3 proposals define named graphs, is not a
standard and not currently supported. There is some confusion about
this. Watch the RDF working group to see what might get adopted in
the future - http://www.w3.org/2011/01/rdf-wg-charter.
There are a number of triple stores that support "named graphs" (aka
quad stores) - TBS supports TDB, SDB, AllegroGraph, Sesame and Oracle
("internal Oracle model name" is basically a named graph). When
creating a connector file for any of these data stores, you can
specify the named graph. Then you use this connector to directly
access and modify the named graph.
An example: Suppose you had a TDB database with a graph named
http://myorg.org/gr1. I'll start by creating a TDB database. Suppose
you have a project named "TestProject". Right-click on the project
name, select New > OWL/RDF Jena TDB Database, and specify the
following in the wizard fields:
File name: myTDB
Base URI: http://myorg.org/tdb/myTDB
Named Graph:
Path to (shared)…:
This will create a folder at /TestProject/myTDB.tdb.data that holds
files representing data. To create a named graph in that database,
create another connector by right-clicking on the project name, select
New > OWL/RDF Jena TDB Database, and specify the following in the
wizard fields:
File name: myTDBgraph_1
Base URI: http://myorg.org/tdb/myTDBgraph1
Named Graph: http://myorg.org/gr1
Path to (shared)…: /TestProject/myTDB.tdb.data
The resulting .tdb file (myTDBgraph_1.tdb) is a connector that goes
directly to the named graph. The connector has a base URI (http://
myorg.org/tdb/myTDBgraph1) that points to the data store (TDB) and the
named graph in that data store (http://myorg.org/gr1). This gives you
a lot of flexibility, as you can now use this .tdb connector to
perform operations directly on the named graph. You can import
the .tdb file, use it in SPARQLMotion scripts, etc., and you will
alway operate on just those triples in the named graph.
For example, if you open the myTDBgraph_1.tdb file in Composer, only
data from the "myTDB.tdb.data -> http://myorg.org/gr1" graph is shown
in the TBC interface. Editing this file in Composer or Ensemble
changes data in that named graph only. As Gokhan states, you can also
use "INSERT INTO <http://myorg.org/tdb/myTDBgraph1>" to insert data
via SPARQL. Note that the .tdb file's URI is used - the name of the
graph is accessible only by going through the data store, and the .tdb
connector takes care of those details for you.
You can create as many named graphs as you need specifying /
TestProject/myTDB.tdb.data as the path to the database.
Hopefully that is enough to get you started, and we'd be happy to take
follow-up questions.
-- Scott
On Mar 19, 4:05 pm, Gokhan Soydan <[email protected]> wrote:
> Hello Tim,
>
> Here are the answers to your questions:
>
> 1-) In TopBraid Composer, you can specify a named graph as the baseURI
> or some other URI depending on the repository in export or import
> wizards. At the repository level, if it is a quad store, then there
> would be quads with the named graph URI, subject, predicate and object.
>
> 2-) In TopBraid Composer, "INSERT INTO <named-graph-URI>" would get the
> resulting triples into the named graph with the specified
> <named-graph-URI>, if the named graph exists within the workspace. That
> named graph would usually be the base URI of an .owl, .ttl or .n3 file
> or .oracle, .sdb, .tdb or .allegro connection file.
>
> Outside TopBraid Composer, each semantic repository have their own
> implementation of named graphs.
>
> Gokhan
>
> On 3/19/2011 9:26 AM, Tim Darr wrote:
>
> > I conceptually understand named graphs, but I cannot seem to find any
> > basic information about how to use them. My two based questions are:
> > 1 - I understand that named graphs are referenced by a URI. Do I first
> > need to create an instance of a "named graph" in order to insert
> > triples into it? If so, is there a "named graph" class? If not, will
> > any old class do?
> > 2 - Once I have a named graph, how do I get triples into it? It looks
> > like CONSTRUCT won't do. Is INSERT INTO the right methd?
>
> > What I am wanting to do it have multiple named graphs in a single Jena
> > TDB store (or AllegroGraph, or OWL / N3 / etc. file). I just can't
> > seem to figure out how to get things up and running.
>
> > Any reference to "named graphs" for dummies will do.
>
> > -Thanks-
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en