identifier: Identifier Consturction

Description Usage Arguments Details Value See Also Examples

View source: R/identifier.R

Description

This is the constructor function for objects of the identifier class.

Usage

1
identifier(id, prefix = NA, blank = FALSE)

Arguments

id

character. Local ID, for example a UUID. The part of identifier after the prefix.

prefix

named character. The name corresponds to the prefix and the proper part to the namespace. Only the first element of the vector will be honored. If you don't supply a prefix, the ID will be treated as a URI and the QNAME and URI will be the same.

blank

optional logical. If you want to create a blank node.

Details

An identifier in the semantic web is something that uniquely identifies a resource. Identifiers can be represented as URI's (e.g. <http://example.com/id>), or as QNAME's (e.g. example:id).

The Semantic Web model also allows for resources to be anonymous, via so-called blank nodes. We use identifiers whose QNAME prefix is an underscore (e.g. _:alice).

RDF4R stores identifiers as lists with the following fields:

sample_id = list( id = "57d68e07-8315-4b30-9a8e-57226fd815d7", uri = "<http://openbiodiv.net/57d68e07-8315-4b30-9a8e-57226fd815d7>", qname = "openbiodiv:id", prefix = c(openbiodiv = "http://openbiodiv.net") )

Value

identifier object (a type of list).

See Also

Other identifier functions: is.identifier, print.identifier, represent.identifier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
a = identifier(
  id = "57d68e07-8315-4b30-9a8e-57226fd815d7",
  prefix = c(openbiodiv = "http://openbiodiv.net")
)

b = identifier(
  id = "alice",
  blank = TRUE
)

a
b

vsenderov/rdf4r documentation built on May 3, 2019, 4:02 p.m.