This document describes a shorthand syntax for RDF. The syntax is similar to N3, but only supports a subset of all syntax features. It is therefore more limited as to what can be represented. On the other hand the syntax improves on certain areas such as the representation of statements about statements.
Resource identifiers are either put in angle brackets [1] or split into a namespace prefix and a name part [2]. Resources identifiers with only a name part and no prefix [3] are considered to be part of the default namespace of a document. Resources identifiers starting with a colon [4] are interpreted relative to the current document.
1. <http://purl.uniprot.org/core/Gene> 2. uniprot:P12345 3. Gene 4. :1
Namespace prefixes may be defined at the top of the document. One namespace may be defined without a prefix. This will be the default namespace of the document.
@prefix <http://purl.uniprot.org/core/> @prefix uniprot <http://purl.uniprot.org/uniprot/>
Literals may be quoted strings, numbers, dates or boolean values.
"Melanotropin alpha" 42 2004-01-01 true
Subjects always appear at the beginning of a new line. Several predicate-object pairs follow, one pair per line, each indented by a single whitespace character.
uniprot:P30090 rdf:type Protein mnemonic 'UPA3_HUMAN' uniprot:P30091 rdf:type Protein mnemonic 'UPA4_HUMAN'
Subjects may be nested:
uniprot:P30090
rdf:type Protein
gene
rdf:type Gene
name "Foo"
classifiedAs keyword:10
rdf:type Concept
name "Transport"
Reified statements are prefixed with a plus sign:
uniprot:P30090 rdfs:seeAlso <http://uniprot.org/> +rdfs:comment "This link is redundant"
There are quite a few examples in the migration guide. Note that those examples often leave out the prefix definitions.
You can also retrieve resources in the shorthand syntax described here from our beta site, e.g. uniprot:P12345.