Graphs-In-Turtle

From RDF Working Group Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "Graphs in Turtle Strawman Assumptions: Alignment with SPARQL is mort important then allignment with N3. The comunity does not have a lot of investment TriG syntax. The comuni…")
Line 1: Line 1:
-
Graphs in Turtle Strawman
+
= Graphs in Turtle Strawman =
-
Assumptions:
+
== Assumptions: ==
Alignment with SPARQL is mort important then allignment with N3.
Alignment with SPARQL is mort important then allignment with N3.
Line 10: Line 10:
-
Advantages of N-Quads:
+
== Advantages of N-Quads: ==
No state outside current line.
No state outside current line.
-
Questions?
+
== Questions? ==
-
Is it possible for N-Quads to be a Subset of Graphs in Turtle?
+
Is it possible for something N-Quad like to be a Subset of Graphs in Turtle?
 +
== Strawman ==
-
  <nowiki>@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
SPARQL uses the GRAPH keyword when talking about graphs, SPARQL keywords tend to match @* keywords in Turtle. <code>@graph</code> seems to follow.
 +
While context coming last in N-Quads makes some sense, providing notation of the graph at the end of a statement doesn't work very well with multi line statements.
 +
 
 +
  <nowiki># N-Graphs
 +
@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://xmlns.com/foaf/0.1/name>                  "Alice"  .
@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://xmlns.com/foaf/0.1/name>                  "Alice"  .
 +
@graph <http://example.org/bob/foaf.rdf> . <http://example.org/bob/foaf.rdf#me>  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
 +
@graph <http://example.org/bob/foaf.rdf> . <http://example.org/bob/foaf.rdf#me>  <http://xmlns.com/foaf/0.1/name>                  "Bob" .
 +
# Graphs in Turtle
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
 +
@prefix void: <http://rdfs.org/ns/void#>
-
@base <http://example.org/alice/foaf.rdf> .
+
<> a void:Dataset .
-
@graph <> .
+
 
 +
@base <http://example.org/alice/foaf.rdf> . #setup a new base
 +
@graph <> . #base matches graph name
<#me> a foaf:Person ;
<#me> a foaf:Person ;
-
     foaf:name "Alice;
+
     foaf:name "Alice";
     .
     .
 +
 +
@base <http://example.org/bob/foaf.rdf> .
 +
@graph <> .
 +
 +
<#me> a foaf:Person ;
 +
      foaf:name "Bob";
 +
      .
 +
@graph . #go back to the default graph
 +
<http://example.org/alice/foaf.rdf> a foaf:Document .
 +
<http://example.org/bob/foaf.rdf> a foaf:Document .
</nowiki>
</nowiki>

Revision as of 22:39, 23 September 2011

Contents

Graphs in Turtle Strawman

Assumptions:

Alignment with SPARQL is mort important then allignment with N3.

The comunity does not have a lot of investment TriG syntax.

The comunity has some investment in N-Quads.


Advantages of N-Quads:

No state outside current line.


Questions?

Is it possible for something N-Quad like to be a Subset of Graphs in Turtle?

Strawman

SPARQL uses the GRAPH keyword when talking about graphs, SPARQL keywords tend to match @* keywords in Turtle. @graph seems to follow. While context coming last in N-Quads makes some sense, providing notation of the graph at the end of a statement doesn't work very well with multi line statements.

# N-Graphs
@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
@graph <http://example.org/alice/foaf.rdf> . <http://example.org/alice/foaf.rdf#me> <http://xmlns.com/foaf/0.1/name>                  "Alice"  .
@graph <http://example.org/bob/foaf.rdf> . <http://example.org/bob/foaf.rdf#me>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
@graph <http://example.org/bob/foaf.rdf> . <http://example.org/bob/foaf.rdf#me>   <http://xmlns.com/foaf/0.1/name>                  "Bob" .

# Graphs in Turtle

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix void: <http://rdfs.org/ns/void#>

<> a void:Dataset .

@base <http://example.org/alice/foaf.rdf> . #setup a new base
@graph <> . #base matches graph name

<#me> a foaf:Person ;
     foaf:name "Alice";
     .

@base <http://example.org/bob/foaf.rdf> .
@graph <> . 

<#me> a foaf:Person ;
      foaf:name "Bob";
      .
@graph . #go back to the default graph
<http://example.org/alice/foaf.rdf> a foaf:Document .
<http://example.org/bob/foaf.rdf> a foaf:Document .

Personal tools