class RDF::Vocabulary::Writer

Vocabulary format specification. This can be used to generate a Ruby class definition from a loaded vocabulary.

Definitions can include recursive term definitions, when the value of a property is a blank-node term. They can also include list definitions, to provide a reasonable way to represent ‘owl:unionOf`-type relationships.

@example a simple term definition

property :comment,
  comment: %(A description of the subject resource.),
  domain: "rdfs:Resource",
  label: "comment",
  range: "rdfs:Literal",
  isDefinedBy: %(rdfs:),
  type: "rdf:Property"

@example an embedded skos:Concept

term :ad,
  exactMatch: [term(
      type: "skos:Concept",
      inScheme: "country:iso3166-1-alpha-2",
      notation: %(ad)
    ), term(
      type: "skos:Concept",
      inScheme: "country:iso3166-1-alpha-3",
      notation: %(and)
    )],
  "foaf:name": "Andorra",
  isDefinedBy: "country:",
  type: "http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#Country"

@example owl:unionOf

property :duration,
  comment: %(The duration of a track or a signal in ms),
  domain: term(
      "owl:unionOf": list("mo:Track", "mo:Signal"),
      type: "owl:Class"
    ),
  isDefinedBy: "mo:",
  "mo:level": "1",
  range: "xsd:float",
  type: "owl:DatatypeProperty",
  "vs:term_status": "testing"

@example term definition with language-tagged strings

property :actor,
  comment: {en: "Subproperty of as:attributedTo that identifies the primary actor"},
  domain: "https://www.w3.org/ns/activitystreams#Activity",
  label: {en: "actor"},
  range: term(
      type: "http://www.w3.org/2002/07/owl#Class",
      unionOf: list("https://www.w3.org/ns/activitystreams#Object", "https://www.w3.org/ns/activitystreams#Link")
    ),
  subPropertyOf: "https://www.w3.org/ns/activitystreams#attributedTo",
  type: "http://www.w3.org/2002/07/owl#ObjectProperty"