Thanks Peter. I noticed your example illustrates the traditional RDF
graph (shown here in TriG):

<http://tinkerpop.com> = {
<http://tinkerpop.com#1> <http://tinkerpop.com#knows> <http://tinkerpop.com#3> .
<http://tinkerpop.com#1> <http://tinkerpop.com#name> "marko" .
<http://tinkerpop.com#3> <http://tinkerpop.com#name> "josh" .
} .

Or in English "Some thing knows some other thing. The first thing's
name is Marko. The other thing's name is Josh."

However, this doesn't technically represent any statements about
statements (i.e. metadata). How would I add a statement, explaining
the attribution of each of these statements and the time when they
were added? For example, if the first statement was "entered-by" a
specific person on a specific date, I would represent this in RDF
like:

<http://tinkerpop.com/stmts#1> = {
<http://tinkerpop.com#1> <http://tinkerpop.com#knows> <http://tinkerpop.com#3> .
} .
<http://tinkerpop.com/stmts#1> <http://tinkerpop.com#enteredby>
<http://tinkerpop.com/users#14232> .
<http://tinkerpop.com/stmts#1> <http://tinkerpop.com#enteredondate>
"2011-1-3"^^xsd:date .

Would the equivalent code simply be the following, or does Tinkerpop
require something more?

sc.addStatement(vf.createURI("http://tinkerpop.com#1";),
vf.createURI("http://tinkerpop.com#knows";),
vf.createURI("http://tinkerpop.com#3";),
vf.createURI("http://tinkerpop.com/stmts#1";));
sc.addStatement(vf.createURI("http://tinkerpop.com/stmts#1";),
vf.createURI("http://tinkerpop.com#enteredby";),
vf.createURI("http://tinkerpop.com/users#14232";),
vf.createURI("http://tinkerpop.com/stmts#1.1";));
sc.addStatement(vf.createURI("http://tinkerpop.com/stmts#1";),
vf.createURI("http://tinkerpop.com#enteredondate";),
vf.createURI("'2011-1-3'^^xsd:date"),
vf.createURI("http://tinkerpop.com/stmts#1.2";));

Regards,
Chris

On Thu, Mar 17, 2011 at 2:36 AM, Peter Neubauer
<[email protected]> wrote:
> Chris,
> the current approach to that is through the Tinkerpop Sail
> implementation on top of Neo4j, see
> https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation.
>
> Basically, you do
>
> Sail sail = new GraphSail(new Neo4jGraph('rdf-store'));
> SailConnection sc = sail.getConnection();
> ValueFactory vf = sail.getValueFactory();
> sc.addStatement(vf.createURI("http://tinkerpop.com#1";),
> vf.createURI("http://tinkerpop.com#knows";),
> vf.createURI("http://tinkerpop.com#3";),
> vf.createURI("http://tinkerpop.com";));
> sc.addStatement(vf.createURI("http://tinkerpop.com#1";),
> vf.createURI("http://tinkerpop.com#name";), vf.createLiteral("marko"),
> vf.createURI("http://tinkerpop.com";));
> sc.addStatement(vf.createURI("http://tinkerpop.com#3";),
> vf.createURI("http://tinkerpop.com#name";), vf.createLiteral("josh"),
> vf.createURI("http://tinkerpop.com";));
>
> System.out.println("get statements: ?s ?p ?o ?g");
> CloseableIteration<? extends Statement, SailException> results =
> sc.getStatements(null, null, null, false);
> while(results.hasNext()) {
>    System.out.println(results.next());
> }
>
> System.out.println("\nget statements: http://tinkerpop.com#3 ?p ?o ?g");
> results = sc.getStatements(vf.createURI("http://tinkerpop.com#3";),
> null, null, false);
> while(results.hasNext()) {
>    System.out.println(results.next());
> }
>
> HTH? Let me know if you need help setting this up!
>
> Cheers,
>
> /peter neubauer
>
> GTalk:      neubauer.peter
> Skype       peter.neubauer
> Phone       +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter      http://twitter.com/peterneubauer
>
> http://www.neo4j.org               - Your high performance graph database.
> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Thu, Mar 17, 2011 at 3:01 AM, Chris Spencer <[email protected]> wrote:
>> Hi,
>>
>> I'm new to Neo4j, and I'm trying to evaluate it as an RDF quadstore.
>> Specifically, where a quad is a 4-tuple of the format (id, subject,
>> predicate, object), quadstores can represent statements about
>> statements by using the id from one quad as the subject, predicate, or
>> object in another quad. Some stores also support a feature called
>> named graphs, where entire sets of quads are grouped, allowing the
>> group to have statements bound to it in a similar way.
>>
>> Has anyone used Neo4j to do anything like this? If so, how is it
>> accomplished, and what is the Neo4j-equivalent terminology?
>>
>> Regards,
>> Chris
>> _______________________________________________
>> Neo4j mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to