From 3f26a8dbe6b9392b6305dfbe443bb60620f3aa2d Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 17 Jan 2022 12:12:19 -0800 Subject: [PATCH 01/16] Exclude '_' and '-' from PN_LOCAL escapes. Not all reserved characters need to be escaped in SPARQL/Turtle, but they must be unescaped when encountered. --- lib/rdf/model/uri.rb | 5 +++-- lib/rdf/vocabulary.rb | 2 +- spec/model_uri_spec.rb | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/rdf/model/uri.rb b/lib/rdf/model/uri.rb index 9ec15660..07695b68 100644 --- a/lib/rdf/model/uri.rb +++ b/lib/rdf/model/uri.rb @@ -112,8 +112,9 @@ class URI ).freeze # Characters in a PName which must be escaped - PN_ESCAPE_CHARS = /[~\.\-!\$&'\(\)\*\+,;=\/\?\#@%_]/.freeze - PN_ESCAPES = /\\#{PN_ESCAPE_CHARS}/.freeze + # Note: not all reserved characters need to be escaped in SPARQL/Turtle, but they must be unescaped when encountered + PN_ESCAPE_CHARS = /[~\.!\$&'\(\)\*\+,;=\/\?\#@%]/.freeze + PN_ESCAPES = /\\#{Regexp.union(PN_ESCAPE_CHARS, /[\-_]/)}/.freeze ## # Cache size may be set through {RDF.config} using `uri_cache_size`. diff --git a/lib/rdf/vocabulary.rb b/lib/rdf/vocabulary.rb index a2d8037f..e8284297 100644 --- a/lib/rdf/vocabulary.rb +++ b/lib/rdf/vocabulary.rb @@ -389,7 +389,7 @@ def expand_pname(pname) return pname unless pname.is_a?(String) || pname.is_a?(Symbol) prefix, suffix = pname.to_s.split(":", 2) # Unescape escaped PN_ESCAPE_CHARS - if suffix.match?(/\\#{RDF::URI::PN_ESCAPE_CHARS}/) + if suffix.match?(RDF::URI::PN_ESCAPES) suffix = suffix.gsub(RDF::URI::PN_ESCAPES) {|matched| matched[1..-1]} end if prefix == "rdf" diff --git a/spec/model_uri_spec.rb b/spec/model_uri_spec.rb index 99580a48..847eac7c 100644 --- a/spec/model_uri_spec.rb +++ b/spec/model_uri_spec.rb @@ -890,7 +890,6 @@ context "escapes" do { - "http://example.org/c-" => 'ex:c\-', "http://example.org/c!" => 'ex:c\!', "http://example.org/c$" => 'ex:c\$', "http://example.org/c&" => 'ex:c\&', @@ -899,7 +898,7 @@ "http://example.org/c*+" => 'ex:c\*\+', "http://example.org/c;=" => 'ex:c\;\=', "http://example.org/c/#" => 'ex:c\/\#', - "http://example.org/c@_" => 'ex:c\@\_', + "http://example.org/c@" => 'ex:c\@', "http://example.org/c:d?" => 'ex:c:d\?', "http://example.org/c~z." => 'ex:c\~z\.', }.each do |orig, result| @@ -910,6 +909,18 @@ expect(pname).to eql result end end + + { + "http://example.org/c-" => 'ex:c\-', + "http://example.org/c_" => 'ex:c\_', + }.each do |orig, result| + it "does not #{orig} => #{result}" do + uri = RDF::URI(orig) + pname = uri.pname(prefixes: {ex: "http://example.org/"}) + expect(uri).to be_valid + expect(pname).not_to eql result + end + end end end From fe501c28a4c40271ffead5d2fed24800c1c9c8bb Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 22 Jan 2022 12:41:15 -0800 Subject: [PATCH 02/16] Improve `#quoted?` accessor for `RDF::Statement`, and set it when parsing embedded triples in NTriples/NQuads. --- lib/rdf/model/statement.rb | 4 +++- lib/rdf/ntriples/reader.rb | 2 +- spec/model_statement_spec.rb | 5 +++++ spec/ntriples_spec.rb | 42 +++++++++++++++++++++++++----------- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/lib/rdf/model/statement.rb b/lib/rdf/model/statement.rb index 322a8697..a1902bae 100644 --- a/lib/rdf/model/statement.rb +++ b/lib/rdf/model/statement.rb @@ -71,6 +71,7 @@ def self.from(statement, graph_name: nil, **options) # @option options [RDF::Term] :graph_name (nil) # Note, in RDF 1.1, a graph name MUST be an {Resource}. # @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box). + # @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement. # @return [RDF::Statement] # # @overload initialize(subject, predicate, object, **options) @@ -83,6 +84,7 @@ def self.from(statement, graph_name: nil, **options) # @option options [RDF::Term] :graph_name (nil) # Note, in RDF 1.1, a graph name MUST be an {Resource}. # @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box). + # @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement. # @return [RDF::Statement] def initialize(subject = nil, predicate = nil, object = nil, options = {}) if subject.is_a?(Hash) @@ -209,7 +211,7 @@ def asserted? ## # @return [Boolean] def quoted? - false + !!@options[:quoted] end ## diff --git a/lib/rdf/ntriples/reader.rb b/lib/rdf/ntriples/reader.rb index 297a77db..03e0eb29 100644 --- a/lib/rdf/ntriples/reader.rb +++ b/lib/rdf/ntriples/reader.rb @@ -255,7 +255,7 @@ def read_quotedTriple if !match(ST_END) log_error("Expected end of statement (found: #{current_line.inspect})", lineno: lineno, exception: RDF::ReaderError) end - RDF::Statement.new(subject, predicate, object) + RDF::Statement.new(subject, predicate, object, quoted: true) end end diff --git a/spec/model_statement_spec.rb b/spec/model_statement_spec.rb index 12718ead..2a069fac 100644 --- a/spec/model_statement_spec.rb +++ b/spec/model_statement_spec.rb @@ -186,6 +186,11 @@ it {is_expected.to be_inferred} end + context "when marked as quoted" do + subject {RDF::Statement.new(RDF::Node.new, p, o, quoted: true)} + it {is_expected.to be_quoted} + end + it {is_expected.to respond_to(:to_h)} its(:to_h) do is_expected.to eql({ diff --git a/spec/ntriples_spec.rb b/spec/ntriples_spec.rb index d5678aa2..774a4329 100644 --- a/spec/ntriples_spec.rb +++ b/spec/ntriples_spec.rb @@ -428,21 +428,37 @@ end end - statements.each do |name, st| - context name do - let(:graph) {parse(st, rdfstar: true)} + context "with rdfstar option" do + statements.each do |name, st| + context name do + let(:graph) {parse(st, rdfstar: true)} + + it "creates two unquoted statements" do + expect(graph.count).to eql(1) + graph.statements.each do |stmt| + expect(stmt).not_to be_quoted + end + end - it "creates two statements" do - expect(graph.count).to eql(1) - end + it "has a statement whose subject or object is a statement" do + referencing = graph.statements.first + expect(referencing).to be_a_statement + if referencing.subject.statement? + expect(referencing.subject).to be_a_statement + else + expect(referencing.object).to be_a_statement + end + end - it "has a statement whose subject or object is a statement" do - referencing = graph.statements.first - expect(referencing).to be_a_statement - if referencing.subject.statement? - expect(referencing.subject).to be_a_statement - else - expect(referencing.object).to be_a_statement + it "statements which are subject or object of another statement are quoted" do + referencing = graph.statements.first + expect(referencing).to be_a_statement + if referencing.subject.statement? + expect(referencing.subject).to be_a_statement + expect(referencing.subject).to be_quoted + else + expect(referencing.object).to be_a_statement + end end end end From 58391cb8d0dd844e41a5f40b9e301177ca6069c9 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 25 Jan 2022 14:01:07 -0800 Subject: [PATCH 03/16] Improve Vocabulary DSL documentation. For #432. --- lib/rdf/vocab/writer.rb | 82 ++++++++++++++++++++--------------------- lib/rdf/vocabulary.rb | 66 ++++++++++++++++++++++++++------- 2 files changed, 93 insertions(+), 55 deletions(-) diff --git a/lib/rdf/vocab/writer.rb b/lib/rdf/vocab/writer.rb index 749d2891..937e0a28 100644 --- a/lib/rdf/vocab/writer.rb +++ b/lib/rdf/vocab/writer.rb @@ -3,53 +3,53 @@ require 'cgi' module RDF - ## - # 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.).freeze, - # domain: "rdfs:Resource".freeze, - # label: "comment".freeze, - # range: "rdfs:Literal".freeze, - # isDefinedBy: %(rdfs:).freeze, - # type: "rdf:Property".freeze - # - # @example an embedded skos:Concept - # term :ad, - # exactMatch: [term( - # type: "skos:Concept".freeze, - # inScheme: "country:iso3166-1-alpha-2".freeze, - # notation: %(ad).freeze - # ), term( - # type: "skos:Concept".freeze, - # inScheme: "country:iso3166-1-alpha-3".freeze, - # notation: %(and).freeze - # )], - # "foaf:name": "Andorra".freeze, - # isDefinedBy: "country:".freeze, - # type: "http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#Country".freeze - # - # @example owl:unionOf - # property :duration, - # comment: %(The duration of a track or a signal in ms).freeze, - # domain: term( - # "owl:unionOf": list("mo:Track".freeze, "mo:Signal".freeze), - # type: "owl:Class".freeze - # ), - # isDefinedBy: "mo:".freeze, - # "mo:level": "1".freeze, - # range: "xsd:float".freeze, - # type: "owl:DatatypeProperty".freeze, - # "vs:term_status": "testing".freeze class Vocabulary class Format < RDF::Format content_encoding 'utf-8' writer { RDF::Vocabulary::Writer } end + ## + # 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.).freeze, + # domain: "rdfs:Resource".freeze, + # label: "comment".freeze, + # range: "rdfs:Literal".freeze, + # isDefinedBy: %(rdfs:).freeze, + # type: "rdf:Property".freeze + # + # @example an embedded skos:Concept + # term :ad, + # exactMatch: [term( + # type: "skos:Concept".freeze, + # inScheme: "country:iso3166-1-alpha-2".freeze, + # notation: %(ad).freeze + # ), term( + # type: "skos:Concept".freeze, + # inScheme: "country:iso3166-1-alpha-3".freeze, + # notation: %(and).freeze + # )], + # "foaf:name": "Andorra".freeze, + # isDefinedBy: "country:".freeze, + # type: "http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#Country".freeze + # + # @example owl:unionOf + # property :duration, + # comment: %(The duration of a track or a signal in ms).freeze, + # domain: term( + # "owl:unionOf": list("mo:Track".freeze, "mo:Signal".freeze), + # type: "owl:Class".freeze + # ), + # isDefinedBy: "mo:".freeze, + # "mo:level": "1".freeze, + # range: "xsd:float".freeze, + # type: "owl:DatatypeProperty".freeze, + # "vs:term_status": "testing".freeze class Writer < RDF::Writer include RDF::Util::Logger format RDF::Vocabulary::Format diff --git a/lib/rdf/vocabulary.rb b/lib/rdf/vocabulary.rb index e8284297..4e4c5dd4 100644 --- a/lib/rdf/vocabulary.rb +++ b/lib/rdf/vocabulary.rb @@ -5,7 +5,14 @@ module RDF # A {Vocabulary} can also serve as a Domain Specific Language (DSL) for generating an RDF Graph definition for the vocabulary (see {RDF::Vocabulary#to_enum}). # # ### Defining a vocabulary using the DSL - # Vocabularies can be defined based on {RDF::Vocabulary} or {RDF::StrictVocabulary} using a simple Domain Specific Language (DSL). Terms of the vocabulary are specified using either `property` or `term` (alias), with the attributes of the term listed in a hash. See {property} for description of the hash. + # Vocabularies can be defined based on {RDF::Vocabulary} or {RDF::StrictVocabulary} using a simple Domain Specific Language (DSL). + # + # * Ontology information for the vocabulary itself can be specified using the {ontology} method. + # * Terms of the vocabulary are specified using either `property` or `term` (alias), with the attributes of the term listed in a hash. See {property} for description of the hash. Term attributes become properties of the associated {RDF::Vocabulary::Term} (see {RDF::Vocabulary::Term#attributes}). + # + # Note that, by default, the prefix associated with the vocabulary for forming and interpreting PNames is created from the class name of the vocabulary. See {\_\_prefix\_\_=} for overriding this at runtime. + # + # The simplest way to generate a DSL representation of a vocabulary is using {RDF::Vocabulary::Writer} given an {RDF::Graph} representation of the vocabulary. # # ### Vocabularies: # @@ -31,6 +38,31 @@ module RDF # foaf.knows #=> RDF::URI("http://xmlns.com/foaf/0.1/knows") # foaf[:name] #=> RDF::URI("http://xmlns.com/foaf/0.1/name") # foaf['mbox'] #=> RDF::URI("http://xmlns.com/foaf/0.1/mbox") + # + # @example Defining a simple vocabulary + # EX = Class.new(RDF::StrictVocabulay("http://example/ns#")) do + # # Ontology definition + # ontology :"http://example/ns#", + # label: "The RDF Example Vocablary".freeze, + # type: "http://www.w3.org/2002/07/owl#Ontology".freeze + # + # # Class definitions + # term :Class, + # label: "My Class", + # comment: "Good to use as an example", + # type: "rdfs:Class", + # subClassOf: "http://example/SuperClass", + # "ex:prop": "Some annotation property not having a shortcut" + # + # # Property definitions + # property :prop, + # comment: "A description of the property".freeze, + # label: "property".freeze, + # domain: "http://example/ns#Class".freeze, + # range: "rdfs:Literal".freeze, + # isDefinedBy: %(ex:).freeze, + # type: "rdf:Property".freeze + # end # # @example Method calls are converted to the typical RDF camelcase convention # foaf = RDF::Vocabulary.new("http://xmlns.com/foaf/0.1/") @@ -44,15 +76,6 @@ module RDF # graph = RDF::Graph.new << RDF::RDFS.to_enum # graph.dump(:ntriples) # - # @example Defining a simple vocabulary - # class EX < RDF::StrictVocabulay("http://example/ns#") - # term :Class, - # label: "My Class", - # comment: "Good to use as an example", - # "rdf:type" => "rdfs:Class", - # "rdfs:subClassOf" => "http://example/SuperClass" - # end - # # @see https://www.w3.org/TR/rdf-sparql-query/#prefNames class Vocabulary extend ::Enumerable @@ -176,7 +199,7 @@ def strict?; false; end # @return [RDF::Vocabulary::Term] # # @overload property(name, options) - # Defines a new property or class in the vocabulary. + # Defines a new property or class in the vocabulary as a {RDF::Vocabulary::Term}. # # @example A simple term definition # property :domain, @@ -1109,7 +1132,7 @@ def other? ## # Enumerate attributes with values transformed into {RDF::Value} instances - # Uses an empty hash with a default_proc which looks up values in attributes. + # Uses an empty hash with a default_proc which looks up values in attributes. The prevents specific attributes from being evaluated until acessed. # # Properties are indexed by symbol. Symbols directly interpreted by a term are the accessors defined for the {RDF::Vocabulary::Term} class, also in {Term::ATTR_URIs}. Other keys are interpreted as absolute URIs or PNames for properties defined on this term. # @@ -1131,7 +1154,20 @@ def properties end ## - # Values of an attributes as {RDF::Value} + # Values of an attributes as {RDF::Value}. + # + # Attribute values are returned as either an {RDF::Value} or {Array] @@ -1246,7 +1282,9 @@ def range_includes rangeIncludes end - # Serialize back to a Ruby source initializer + ## + # Serialize back to a Ruby source initializer. This is used primarily by {RDF::Vocabulary::Writer}. + # # @param [String] indent # @return [String] def to_ruby(indent: "") From 7bf8fa3f30941670589840e39db6830507592109 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 26 Jan 2022 17:25:43 -0800 Subject: [PATCH 04/16] Document and parse datatype/language maps as part of Term attribute definitions. --- lib/rdf/vocabulary.rb | 176 ++++++++++++++------------------------ spec/vocab_writer_spec.rb | 2 +- spec/vocabulary_spec.rb | 77 +++++++++++++---- 3 files changed, 127 insertions(+), 128 deletions(-) diff --git a/lib/rdf/vocabulary.rb b/lib/rdf/vocabulary.rb index 4e4c5dd4..bef307b1 100644 --- a/lib/rdf/vocabulary.rb +++ b/lib/rdf/vocabulary.rb @@ -43,8 +43,8 @@ module RDF # EX = Class.new(RDF::StrictVocabulay("http://example/ns#")) do # # Ontology definition # ontology :"http://example/ns#", - # label: "The RDF Example Vocablary".freeze, - # type: "http://www.w3.org/2002/07/owl#Ontology".freeze + # label: "The RDF Example Vocablary", + # type: "http://www.w3.org/2002/07/owl#Ontology" # # # Class definitions # term :Class, @@ -56,12 +56,12 @@ module RDF # # # Property definitions # property :prop, - # comment: "A description of the property".freeze, - # label: "property".freeze, - # domain: "http://example/ns#Class".freeze, - # range: "rdfs:Literal".freeze, - # isDefinedBy: %(ex:).freeze, - # type: "rdf:Property".freeze + # comment: "A description of the property", + # label: "property", + # domain: "http://example/ns#Class", + # range: "rdfs:Literal", + # isDefinedBy: %(ex:), + # type: "rdf:Property" # end # # @example Method calls are converted to the typical RDF camelcase convention @@ -203,12 +203,24 @@ def strict?; false; end # # @example A simple term definition # property :domain, - # comment: %(A domain of the subject property.).freeze, - # domain: "rdf:Property".freeze, - # label: "domain".freeze, - # range: "rdfs:Class".freeze, - # isDefinedBy: %(rdfs:).freeze, - # type: "rdf:Property".freeze + # comment: %(A domain of the subject property.), + # domain: "rdf:Property", + # label: "domain", + # range: "rdfs:Class", + # isDefinedBy: %(rdfs:), + # type: "rdf:Property" + # + # @example A term definition with tagged values + # 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" # # @example A SKOS term with anonymous values # term: :af, @@ -227,76 +239,8 @@ def strict?; false; end # "foaf:name": "Aland Islands" # # @param [String, #to_s] name - # @param [Hash{Symbol=>String,Array}] options - # Any other values are expected to expands to a {URI} using built-in vocabulary prefixes. The value is a `String`, `Array` or `Array` which is interpreted according to the `range` of the associated property. - # @option options [String, Array] :type - # Shortcut for `rdf:type`, values are interpreted as a {Term}. - # @option options [String, Array] :comment - # Shortcut for `rdfs:comment`, values are interpreted as a {Literal}. - # @option options [String, Array] :domain - # Shortcut for `rdfs:domain`, values are interpreted as a {Term}. - # @option options [String, Array] :isDefinedBy - # Shortcut for `rdfs:isDefinedBy`, values are interpreted as a {Term}. - # @option options [String, Array] :label - # Shortcut for `rdfs:label`, values are interpreted as a {Literal}. - # @option options [String, Array] :range - # Shortcut for `rdfs:range`, values are interpreted as a {Term}. - # @option options [String, Array] :subClassOf - # Shortcut for `rdfs:subClassOf`, values are interpreted as a {Term}. - # @option options [String, Array] :subPropertyOf - # Shortcut for `rdfs:subPropertyOf`, values are interpreted as a {Term}. - # @option options [String, Array] :allValuesFrom - # Shortcut for `owl:allValuesFrom`, values are interpreted as a {Term}. - # @option options [String, Array] :cardinality - # Shortcut for `owl:cardinality`, values are interpreted as a {Literal}. - # @option options [String, Array] :equivalentClass - # Shortcut for `owl:equivalentClass`, values are interpreted as a {Term}. - # @option options [String, Array] :equivalentProperty - # Shortcut for `owl:equivalentProperty`, values are interpreted as a {Term}. - # @option options [String, Array] :intersectionOf - # Shortcut for `owl:intersectionOf`, values are interpreted as a {Term}. - # @option options [String, Array] :inverseOf - # Shortcut for `owl:inverseOf`, values are interpreted as a {Term}. - # @option options [String, Array] :maxCardinality - # Shortcut for `owl:maxCardinality`, values are interpreted as a {Literal}. - # @option options [String, Array] :minCardinality - # Shortcut for `owl:minCardinality`, values are interpreted as a {Literal}. - # @option options [String, Array] :onProperty - # Shortcut for `owl:onProperty`, values are interpreted as a {Term}. - # @option options [String, Array] :someValuesFrom - # Shortcut for `owl:someValuesFrom`, values are interpreted as a {Term}. - # @option options [String, Array] :unionOf - # Shortcut for `owl:unionOf`, values are interpreted as a {Term}. - # @option options [String, Array] :domainIncludes - # Shortcut for `schema:domainIncludes`, values are interpreted as a {Term}. - # @option options [String, Array] :rangeIncludes - # Shortcut for `schema:rangeIncludes`, values are interpreted as a {Term}. - # @option options [String, Array] :altLabel - # Shortcut for `skos:altLabel`, values are interpreted as a {Literal}. - # @option options [String, Array] :broader - # Shortcut for `skos:broader`, values are interpreted as a {Term}. - # @option options [String, Array] :definition - # Shortcut for `skos:definition`, values are interpreted as a {Literal}. - # @option options [String, Array] :editorialNote - # Shortcut for `skos:editorialNote`, values are interpreted as a {Literal}. - # @option options [String, Array] :exactMatch - # Shortcut for `skos:exactMatch`, values are interpreted as a {Term}. - # @option options [String, Array] :hasTopConcept - # Shortcut for `skos:hasTopConcept`, values are interpreted as a {Term}. - # @option options [String, Array] :inScheme - # Shortcut for `skos:inScheme`, values are interpreted as a {Term}. - # @option options [String, Array] :member - # Shortcut for `skos:member`, values are interpreted as a {Term}. - # @option options [String, Array] :narrower - # Shortcut for `skos:narrower`, values are interpreted as a {Term}. - # @option options [String, Array] :notation - # Shortcut for `skos:notation`, values are interpreted as a {Literal}. - # @option options [String, Array] :note - # Shortcut for `skos:note`, values are interpreted as a {Literal}. - # @option options [String, Array] :prefLabel - # Shortcut for `skos:prefLabel`, values are interpreted as a {Literal}. - # @option options [String, Array] :related - # Shortcut for `skos:related`, values are interpreted as a {Term}. + # @param [Hash{Symbol=>String,Array}] options + # Any other values are expected to expands to a {URI} using built-in vocabulary prefixes. The value is a `String`, 'Hash{Symbol=>String,Array}' or `ArrayArray}>` which is interpreted according to the `range` of the associated property and by heuristically determining the value datatype. See `attributes` argument to {Term#initialize}. # @return [RDF::Vocabulary::Term] def property(*args) case args.length @@ -309,15 +253,6 @@ def property(*args) uri_str = [to_s, name.to_s].join('') URI.cache.delete(uri_str.to_sym) # Clear any previous entry - # Transform attribute keys that are PNames with a warning - # FIXME: add back later - #if !@is_deprecated && options.is_a?(Hash) && - # options.keys.map(&:to_s).any? {|k| k.include?(':') && !k.match?(/^https?:/)} - # - # @is_deprecated = true - # warn "[DEPRECATION] Vocabulary #{to_uri} includes pname attribute keys, regenerate" - #end - # Term attributes passed in a block for lazy evaluation. This helps to avoid load-time circular dependencies prop = Term.intern(uri_str, vocab: self, attributes: options || {}) props[name.to_sym] = prop @@ -985,6 +920,10 @@ module Term # # Symbols which are accessors may also be looked up by their associated URI. # + # Values may be Strings, Hash (Map), or Terms, or an Array including a combination of these. A Hash (Map) is used to create a datatype/language map to one or more string values which represent either datatyped literals, or language-tagged literals as interpreted by {#attribute_value}. + # + # In general, this accessor is used internally. The {#properties} method interprets these values as {RDF::Value}. + # # @note lookup by PName is DEPRECATED and will be removed in a future version. # # @example looking up term label @@ -993,23 +932,23 @@ module Term # RDF::RDFS.Literal.attributes[RDF::RDFS.label] #=> "Literal" # RDF::RDFS.Literal.attributes["http://www.w3.org/2000/01/rdf-schema#label"] #=> "Literal" # RDF::RDFS.Literal.attributes[:"http://www.w3.org/2000/01/rdf-schema#label"] #=> "Literal" - # @return [Hash{Symbol,Resource => Term, #to_s}] + # @return [Hash{Symbol => String, Term, Hash{Symbol => String}, Array String}>}] + # @see #properties attr_reader :attributes ## - # @overload new(uri, attributes:, **options) + # @overload new(uri, attributes:, vocab:, **options) # @param [URI, String, #to_s] uri # @param [Vocabulary] vocab Vocabulary of this term. - # @param [Hash{Symbol => Symbol,Array}] attributes ({}) + # @param [Hash{Symbol => String,Term,Hash{Symbol=>String,Array},Array}] attributes ({}) # Attributes of this vocabulary term, used for finding `label` and `comment` and to serialize the term back to RDF. See {#attributes} and {#properties} for other ways to access. # @param [Hash{Symbol => Object}] options # Options from {URI#initialize} # - # @overload new(attributes:, **options) - # @param [Hash{Symbol => Object}] options + # @overload new(attributes:, vocab:, **options) # @param [Vocabulary] vocab Vocabulary of this term. - # @param [Hash{Symbol => Symbol,Array}] attributes ({}) - # Attributes of this vocabulary term, used for finding `label` and `comment` and to serialize the term back to RDF. See {#attributes} and {#properties} for other ways to access. + # @param [Hash{Symbol => String,Term,Hash{Symbol=>String,Array},Array}] attributes ({}) + # Attributes of this vocabulary term, used for finding `label`, `comment` and other term properties, and to serialize the term back to RDF. See {#attributes} and {#properties} for other ways to access. # @param [Hash{Symbol => Object}] options # Options from {URI#initialize} def self.new(*args, vocab: nil, attributes: {}, **options) @@ -1149,6 +1088,7 @@ def other? # RDF::RDFS.Literal.properties[:"http://www.w3.org/2000/01/rdf-schema#label"] #=> RDF::Literal("Literal") # # @return [Hash{Symbol => Array}] + # @see #attribute_value def properties Hash.new {|hash, key| attribute_value(key)} end @@ -1161,7 +1101,8 @@ def properties # Attribute values which are not already a {RDF::Value} (including strings and symbols) are converted by a heuristic loookup as follows: # # * An {RDF::URI} if it can be turned into a valid IRI using {RDF::Vocabulary.expand_pname}. This includes IRIs already in non-relative form. - # * {RDF::Literal::Date} if valud, + # * A {Hash{Symbol=>String,Array}} is interpreted as a datatype/language map. If the key contains a ':', it is treated as a PName or IRI datatype applied to the values. Otherwise, it is treated as a language-tag applied to the values. + # * {RDF::Literal::Date} if valid, # * {RDF::Literal::DateTime} if valid, # * {RDF::Literal::Integer} if valid, # * {RDF::Literal::Decimal} if valid, @@ -1179,9 +1120,22 @@ def attribute_value(prop) v = value.is_a?(Symbol) ? value.to_s : value value = (RDF::Vocabulary.expand_pname(v) rescue nil) if v.is_a?(String) && v.include?(':') value = value.to_uri if value.respond_to?(:to_uri) - unless value.is_a?(RDF::Value) && value.valid? + value = if value.is_a?(RDF::Value) && value.valid? + value + elsif value.is_a?(Hash) + # type/language map + value.inject([]) do |memo, (k,v)| + vv = [v] unless v.is_a?(Array) + memo << if k.to_s.include?(':') + dt = RDF::Vocabulary.expand_pname(v) rescue nil + vv.map {|val| RDF::Literal(val, datatype: dt)} + else + vv.map {|val| RDF::Literal(val, language: k)} + end + end.flatten.compact.select(&:valid?) + else # Use as most appropriate literal - value = [ + [ RDF::Literal::Date, RDF::Literal::DateTime, RDF::Literal::Integer, @@ -1196,9 +1150,7 @@ def attribute_value(prop) end end end - - value - end + end.flatten prop_values.length <= 1 ? prop_values.first : prop_values end @@ -1296,24 +1248,24 @@ def to_ruby(indent: "") values = [values].compact unless values.is_a?(Array) values = values.map do |value| if value.is_a?(Literal) && %w(: comment definition notation note editorialNote).include?(k.to_s) - "%(#{value.to_s.gsub('(', '\(').gsub(')', '\)')}).freeze" + "%(#{value.to_s.gsub('(', '\(').gsub(')', '\)')})" elsif value.node? && value.is_a?(RDF::Vocabulary::Term) - "#{value.to_ruby(indent: indent + " ")}.freeze" + "#{value.to_ruby(indent: indent + " ")}" elsif value.is_a?(RDF::Term) - "#{value.to_s.inspect}.freeze" + "#{value.to_s.inspect}" elsif value.is_a?(RDF::List) list_elements = value.map do |u| if u.uri? - "#{u.to_s.inspect}.freeze" + "#{u.to_s.inspect}" elsif u.node? && u.respond_to?(:to_ruby) u.to_ruby(indent: indent + " ") else - "#{u.to_s.inspect}.freeze" + "#{u.to_s.inspect}" end end "list(#{list_elements.join(', ')})" else - "#{value.inspect}.freeze" + "#{value.inspect}" end end "#{k.to_s.include?(':') ? k.to_s.inspect : k}: " + diff --git a/spec/vocab_writer_spec.rb b/spec/vocab_writer_spec.rb index 5a09d166..64a64b9f 100644 --- a/spec/vocab_writer_spec.rb +++ b/spec/vocab_writer_spec.rb @@ -84,7 +84,7 @@ /term :ClassList/, /label: "ClassList"/.freeze, /subClassOf: term\(/, - %r{unionOf: list\("http://example.org/C1".freeze, "http://example.org/C2".freeze\)}, + %r{unionOf: list\("http://example.org/C1", "http://example.org/C2"\)}, %r{type: "http://www.w3.org/2000/01/rdf-schema#Class"}.freeze, ].each do |regexp,| it "matches #{regexp}" do diff --git a/spec/vocabulary_spec.rb b/spec/vocabulary_spec.rb index bbfba9bf..d8e63592 100644 --- a/spec/vocabulary_spec.rb +++ b/spec/vocabulary_spec.rb @@ -213,6 +213,13 @@ potential to perform intentional actions for which they can be held responsible.).freeze end + it "defines a property with a language map" do + subject.property :lang, definition: {en: "English Definition"} + expect(subject.lang.definition).to be_a_literal + expect(subject.lang.definition.language).to eq :en + expect(subject.lang.definition.value).to eq "English Definition" + end + it "defines a property with equivalentClass using anonymous term" do subject.property :foo, equivalentClass: subject.term( type: "owl:Restriction", @@ -671,16 +678,16 @@ its(:vocab) {is_expected.to eql RDF::XSD} end - context ".new" do + describe ".new" do subject { RDF::Vocabulary::Term.new(:foo, - attributes: { - label: "foo", - domain: RDF::RDFS.Resource, - range: [RDF::RDFS.Resource, RDF::RDFS.Class], - domainIncludes: RDF::RDFS.Resource, - rangeIncludes: [RDF::RDFS.Resource, RDF::RDFS.Class], - }) + attributes: { + label: "foo", + domain: RDF::RDFS.Resource, + range: [RDF::RDFS.Resource, RDF::RDFS.Class], + domainIncludes: RDF::RDFS.Resource, + rangeIncludes: [RDF::RDFS.Resource, RDF::RDFS.Class], + }) } it {is_expected.to be_a(RDF::URI)} it {is_expected.to be_a(RDF::Vocabulary::Term)} @@ -697,16 +704,56 @@ end end + context "with attribute value combinations" do + subject { + RDF::Vocabulary::Term.new(:prop, + attributes: { + str: "foo", + strary: ["foo", "bar"], + map: {en: "foo", "xsd:string": "bar"}, + arystrmap: ["baz", {en: "foo", "xsd:string": "bar"}], + date: "2021-01-26", + datetime: "2021-01-26T17:21:00Z", + integer: "10", + decimal: "10.1", + double: "10.1e10", + boolean: "true" + }) + } + + it(:str) {expect(subject.attribute_value(:str)).to eq "foo"} + it(:strary) {expect(subject.attribute_value(:strary)).to eq %w(foo bar)} + it(:map) do + expect(subject.attribute_value(:map)).to eq [ + RDF::Literal("foo", language: :en), + RDF::Literal("bar", datatype: RDF::XSD.string), + ] + end + it(:arystrmap) do + expect(subject.attribute_value(:arystrmap)).to eq [ + RDF::Literal("baz"), + RDF::Literal("foo", language: :en), + RDF::Literal("bar", datatype: RDF::XSD.string), + ] + end + it(:date) {expect(subject.attribute_value(:date)).to eq RDF::Literal::Date.new("2021-01-26")} + it(:datetime) {expect(subject.attribute_value(:datetime)).to eq RDF::Literal::DateTime.new("2021-01-26T17:21:00Z")} + it(:integer) {expect(subject.attribute_value(:integer)).to eq RDF::Literal(10)} + it(:decimal) {expect(subject.attribute_value(:decimal)).to eq RDF::Literal::Decimal.new("10.1")} + it(:double) {expect(subject.attribute_value(:double)).to eq RDF::Literal(10.1e10)} + it(:boolean) {expect(subject.attribute_value(:boolean)).to eq RDF::Literal(true)} + end + context "with a BNode Label" do subject { RDF::Vocabulary::Term.new(:"_:foo", - attributes: { - label: "foo", - domain: RDF::RDFS.Resource, - range: [RDF::RDFS.Resource, RDF::RDFS.Class], - domainIncludes: RDF::RDFS.Resource, - rangeIncludes: [RDF::RDFS.Resource, RDF::RDFS.Class], - }) + attributes: { + label: "foo", + domain: RDF::RDFS.Resource, + range: [RDF::RDFS.Resource, RDF::RDFS.Class], + domainIncludes: RDF::RDFS.Resource, + rangeIncludes: [RDF::RDFS.Resource, RDF::RDFS.Class], + }) } it {is_expected.to be_a(RDF::Node)} it {is_expected.to be_a(RDF::Vocabulary::Term)} From 8d79f7935980f75c72c6ad61e23ced92d8356043 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 27 Jan 2022 14:53:31 -0800 Subject: [PATCH 05/16] Update documentation links to use gh-pages, and add action to publish gh-pages from Yard docs. --- .github/workflows/generate-docs.yml | 27 +++++++++++ README.md | 74 ++++++++++++++--------------- rdf.gemspec | 4 +- spec/model_graph_spec.rb | 10 ++-- spec/readme_spec.rb | 8 ++-- spec/util_file_spec.rb | 2 +- 6 files changed, 76 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/generate-docs.yml diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 00000000..6f34e70a --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -0,0 +1,27 @@ +name: Build & deploy documentation +on: + push: + branches: + - master + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + name: Update gh-pages with docs + steps: + - name: Checkout this repo + uses: actions/checkout@v2 + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: "3.1" + - name: Install required gem dependencies + run: gem install yard --no-document + - name: Build YARD Ruby Documentation + run: yardoc + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: $ + publish_dir: ./doc/yard + publish_branch: gh-pages diff --git a/README.md b/README.md index 088b1159..8f656ee1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a pure-Ruby library for working with [Resource Description Framework (RDF)][RDF] data. -* +* [![Gem Version](https://badge.fury.io/rb/rdf.png)](https://badge.fury.io/rb/rdf) [![Build Status](https://github.com/ruby-rdf/rdf/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf/actions?query=workflow%3ACI) @@ -141,11 +141,11 @@ or ### Reading RDF data in the [N-Triples][] format require 'rdf/ntriples' - graph = RDF::Graph.load("https://ruby-rdf.github.com/rdf/etc/doap.nt") + graph = RDF::Graph.load("https://ruby-rdf.github.io/rdf/etc/doap.nt") or - RDF::Reader.open("https://ruby-rdf.github.com/rdf/etc/doap.nt") do |reader| + RDF::Reader.open("https://ruby-rdf.github.io/rdf/etc/doap.nt") do |reader| reader.each_statement do |statement| puts statement.inspect end @@ -160,13 +160,13 @@ MimeType or file extension, where available. require 'rdf/nquads' - graph = RDF::Graph.load("https://ruby-rdf.github.com/rdf/etc/doap.nq", format: :nquads) + graph = RDF::Graph.load("https://ruby-rdf.github.io/rdf/etc/doap.nq", format: :nquads) A specific sub-type of Reader can also be invoked directly: require 'rdf/nquads' - RDF::NQuads::Reader.open("https://ruby-rdf.github.com/rdf/etc/doap.nq") do |reader| + RDF::NQuads::Reader.open("https://ruby-rdf.github.io/rdf/etc/doap.nq") do |reader| reader.each_statement do |statement| puts statement.inspect end @@ -220,7 +220,7 @@ Note that no prefixes are loaded automatically, however they can be provided as require 'rdf/ntriples' - graph = RDF::Graph.load("https://ruby-rdf.github.com/rdf/etc/doap.nt") + graph = RDF::Graph.load("https://ruby-rdf.github.io/rdf/etc/doap.nt") query = RDF::Query.new({ person: { RDF.type => FOAF.Person, @@ -295,7 +295,7 @@ Readers support a boolean valued `rdfstar` option. ## Documentation - + ### RDF Object Model @@ -309,7 +309,7 @@ Readers support a boolean valued `rdfstar` option. * {RDF::Literal::Double} * {RDF::Literal::Integer} * {RDF::Literal::Time} - * [RDF::XSD](https://rubydoc.info/github/gkellogg/rdf-xsd) (extension) + * [RDF::XSD](https://ruby-rdf.github.io/rdf-xsd) (extension) * {RDF::Resource} * {RDF::Node} * {RDF::URI} @@ -371,10 +371,10 @@ from BNode identity (i.e., they each entail the other) * {RDF::Mutable} * {RDF::Durable} * {RDF::Transaction} -* [RDF::AllegroGraph](https://rubydoc.info/github/ruby-rdf/rdf-agraph) (extension) -* [RDF::Mongo](https://rubydoc.info/github/ruby-rdf/rdf-mongo) (extension) -* [RDF::DataObjects](https://rubydoc.info/github/ruby-rdf/rdf-do) (extension) -* [RDF::Sesame](https://rubydoc.info/github/ruby-rdf/rdf-sesame) (extension) +* [RDF::AllegroGraph](https://ruby-rdf.github.io/rdf-agraph) (extension) +* [RDF::Mongo](https://ruby-rdf.github.io/rdf-mongo) (extension) +* [RDF::DataObjects](https://ruby-rdf.github.io/rdf-do) (extension) +* [RDF::Sesame](https://ruby-rdf.github.io/rdf-sesame) (extension) ### RDF Querying @@ -384,7 +384,7 @@ from BNode identity (i.e., they each entail the other) * {RDF::Query::Solution} * {RDF::Query::Solutions} * {RDF::Query::Variable} -* [SPARQL](https://rubydoc.info/github/ruby-rdf/sparql) (extension) +* [SPARQL](https://ruby-rdf.github.io/sparql) (extension) ### RDF Vocabularies @@ -422,7 +422,7 @@ follows: ## Resources -* +* * * * @@ -486,33 +486,33 @@ see or the accompanying {file:UNLICENSE} file. [YARD]: https://yardoc.org/ [YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md [PDD]: https://unlicense.org/#unlicensing-contributions -[JSONLD doc]: https://rubydoc.info/github/ruby-rdf/json-ld -[LinkedData doc]: https://rubydoc.info/github/ruby-rdf/linkeddata -[Microdata doc]: https://rubydoc.info/github/ruby-rdf/rdf-microdata -[N3 doc]: https://rubydoc.info/github/ruby-rdf/rdf-n3 -[RDFa doc]: https://rubydoc.info/github/ruby-rdf/rdf-rdfa -[RDFXML doc]: https://rubydoc.info/github/ruby-rdf/rdf-rdfxml -[Turtle doc]: https://rubydoc.info/github/ruby-rdf/rdf-turtle -[SPARQL doc]: https://rubydoc.info/github/ruby-rdf/sparql +[JSONLD doc]: https://ruby-rdf.github.io/json-ld +[LinkedData doc]: https://ruby-rdf.github.io/linkeddata +[Microdata doc]: https://ruby-rdf.github.io/rdf-microdata +[N3 doc]: https://ruby-rdf.github.io/rdf-n3 +[RDFa doc]: https://ruby-rdf.github.io/rdf-rdfa +[RDFXML doc]: https://ruby-rdf.github.io/rdf-rdfxml +[Turtle doc]: https://ruby-rdf.github.io/rdf-turtle +[SPARQL doc]: https://ruby-rdf.github.io/sparql [RDF 1.0]: https://www.w3.org/TR/2004/REC-rdf-concepts-20040210/ [RDF 1.1]: https://www.w3.org/TR/rdf11-concepts/ [SPARQL 1.1]: https://www.w3.org/TR/sparql11-query/ -[RDF.rb]: https://ruby-rdf.github.com/ -[RDF::DO]: https://ruby-rdf.github.com/rdf-do -[RDF::Mongo]: https://ruby-rdf.github.com/rdf-mongo -[RDF::Sesame]: https://ruby-rdf.github.com/rdf-sesame -[RDF::JSON]: https://ruby-rdf.github.com/rdf-json -[RDF::Microdata]: https://ruby-rdf.github.com/rdf-microdata -[RDF::N3]: https://ruby-rdf.github.com/rdf-n3 -[RDF::RDFa]: https://ruby-rdf.github.com/rdf-rdfa -[RDF::RDFXML]: https://ruby-rdf.github.com/rdf-rdfxml -[RDF::TriG]: https://ruby-rdf.github.com/rdf-trig -[RDF::TriX]: https://ruby-rdf.github.com/rdf-trix -[RDF::Turtle]: https://ruby-rdf.github.com/rdf-turtle -[RDF::Raptor]: https://ruby-rdf.github.com/rdf-raptor +[RDF.rb]: https://ruby-rdf.github.io/ +[RDF::DO]: https://ruby-rdf.github.io/rdf-do +[RDF::Mongo]: https://ruby-rdf.github.io/rdf-mongo +[RDF::Sesame]: https://ruby-rdf.github.io/rdf-sesame +[RDF::JSON]: https://ruby-rdf.github.io/rdf-json +[RDF::Microdata]: https://ruby-rdf.github.io/rdf-microdata +[RDF::N3]: https://ruby-rdf.github.io/rdf-n3 +[RDF::RDFa]: https://ruby-rdf.github.io/rdf-rdfa +[RDF::RDFXML]: https://ruby-rdf.github.io/rdf-rdfxml +[RDF::TriG]: https://ruby-rdf.github.io/rdf-trig +[RDF::TriX]: https://ruby-rdf.github.io/rdf-trix +[RDF::Turtle]: https://ruby-rdf.github.io/rdf-turtle +[RDF::Raptor]: https://ruby-rdf.github.io/rdf-raptor [RDF*]: https://w3c.github.io/rdf-star/rdf-star-cg-spec.html -[LinkedData]: https://ruby-rdf.github.com/linkeddata -[JSON::LD]: https://ruby-rdf.github.com/json-ld +[LinkedData]: https://ruby-rdf.github.io/linkeddata +[JSON::LD]: https://ruby-rdf.github.io/json-ld [RestClient]: https://rubygems.org/gems/rest-client [RestClient Components]: https://rubygems.org/gems/rest-client-components [Rack::Cache]: https://rtomayko.github.io/rack-cache/ diff --git a/rdf.gemspec b/rdf.gemspec index f7077387..f1f0e181 100755 --- a/rdf.gemspec +++ b/rdf.gemspec @@ -11,9 +11,9 @@ Gem::Specification.new do |gem| gem.summary = 'A Ruby library for working with Resource Description Framework (RDF) data.' gem.description = 'RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.' gem.metadata = { - "documentation_uri" => "https://rubydoc.info/github/ruby-rdf/rdf", + "documentation_uri" => "https://ruby-rdf.github.io/rdf", "bug_tracker_uri" => "https://github.com/ruby-rdf/rdf/issues", - "homepage_uri" => "https://ruby-rdf.github.io/rdf", + "homepage_uri" => "https://github.com/ruby-rdf/rdf", "mailing_list_uri" => "https://lists.w3.org/Archives/Public/public-rdf-ruby/", "source_code_uri" => "https://github.com/ruby-rdf/rdf", } diff --git a/spec/model_graph_spec.rb b/spec/model_graph_spec.rb index cb5da524..1f8f699e 100644 --- a/spec/model_graph_spec.rb +++ b/spec/model_graph_spec.rb @@ -16,13 +16,13 @@ context "as method" do it "with keyword arg" do - expect(described_class).to receive(:new).with(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt") - RDF::Graph(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt") + expect(described_class).to receive(:new).with(graph_name: "https://ruby-rdf.github.io/rdf/etc/doap.nt") + RDF::Graph(graph_name: "https://ruby-rdf.github.io/rdf/etc/doap.nt") end it "with positional arg (removed)" do expect { - RDF::Graph("http://ruby-rdf.github.com/rdf/etc/doap.nt") + RDF::Graph("https://ruby-rdf.github.io/rdf/etc/doap.nt") }.to raise_error(ArgumentError) end end @@ -47,7 +47,7 @@ context "named graphs" do subject { - described_class.new(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt", data: RDF::Repository.new) + described_class.new(graph_name: "https://ruby-rdf.github.io/rdf/etc/doap.nt", data: RDF::Repository.new) } it "should be instantiable" do expect { subject }.to_not raise_error @@ -55,7 +55,7 @@ it "should not be instantiable with positional arg" do expect { - described_class.new("http://ruby-rdf.github.com/rdf/etc/doap.nt", data: RDF::Repository.new) + described_class.new("https://ruby-rdf.github.io/rdf/etc/doap.nt", data: RDF::Repository.new) }.to raise_error(ArgumentError) end diff --git a/spec/readme_spec.rb b/spec/readme_spec.rb index ede6e3f4..6d8f54ca 100644 --- a/spec/readme_spec.rb +++ b/spec/readme_spec.rb @@ -52,7 +52,7 @@ { example0: lambda { require 'rdf/ntriples' - RDF::NTriples::Reader.open("http://ruby-rdf.github.com/rdf/etc/doap.nt") do |reader| + RDF::NTriples::Reader.open("https://ruby-rdf.github.io/rdf/etc/doap.nt") do |reader| reader.each_statement do |statement| puts statement.inspect end @@ -72,7 +72,7 @@ subject { if example == :example0 expect(RDF::Util::File).to receive(:open_file). - with("http://ruby-rdf.github.com/rdf/etc/doap.nt", hash_including(:headers)). + with("https://ruby-rdf.github.io/rdf/etc/doap.nt", hash_including(:headers)). at_least(1). and_yield(Kernel.open(File.expand_path("../../etc/doap.nt", __FILE__))) end @@ -90,7 +90,7 @@ example0: lambda { require 'rdf/nquads' - graph = RDF::Graph.load("http://ruby-rdf.github.com/rdf/etc/doap.nq", format: :nquads) + graph = RDF::Graph.load("https://ruby-rdf.github.io/rdf/etc/doap.nq", format: :nquads) graph.each_statement do |statement| puts statement.inspect end @@ -109,7 +109,7 @@ subject { if example == :example0 expect(RDF::Util::File).to receive(:open_file). - with("http://ruby-rdf.github.com/rdf/etc/doap.nq", hash_including(:headers, base_uri: "http://ruby-rdf.github.com/rdf/etc/doap.nq")). + with("https://ruby-rdf.github.io/rdf/etc/doap.nq", hash_including(:headers, base_uri: "https://ruby-rdf.github.io/rdf/etc/doap.nq")). at_least(1). and_yield(Kernel.open(File.expand_path("../../etc/doap.nq", __FILE__))) end diff --git a/spec/util_file_spec.rb b/spec/util_file_spec.rb index 882ea14b..9b1ef138 100644 --- a/spec/util_file_spec.rb +++ b/spec/util_file_spec.rb @@ -83,7 +83,7 @@ end describe ".open_file" do - let(:uri) {"http://ruby-rdf.github.com/rdf/etc/doap.nt"} + let(:uri) {"https://ruby-rdf.github.io/rdf/etc/doap.nt"} let(:opened) {double("opened")} before(:each) do expect(opened).to receive(:opened) From 1bd024949bfbd7a91610fae9bf06bf2637e26af1 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 27 Jan 2022 14:58:18 -0800 Subject: [PATCH 06/16] Tweak doc build action. --- .github/workflows/generate-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 6f34e70a..4aadab88 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest name: Update gh-pages with docs steps: - - name: Checkout this repo + - name: Clone repository uses: actions/checkout@v2 - name: Set up Ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" - name: Install required gem dependencies From d8fa144960df16852bc4b8500c41b2226427ef91 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 27 Jan 2022 15:04:00 -0800 Subject: [PATCH 07/16] Use GITHUB_TOKEN secret. --- .github/workflows/generate-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 4aadab88..b8d16ed9 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -22,6 +22,6 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: - github_token: $ + github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/yard publish_branch: gh-pages From b710c4e907e239d7335ec090584b690674de370b Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 28 Jan 2022 12:34:40 -0800 Subject: [PATCH 08/16] * Remove more redundant string freezes. * Add Yard tag to prevent parsing vocabularies if :noDoc is set. --- lib/rdf/vocab/owl.rb | 895 +++++++++++++++++++------------------- lib/rdf/vocab/rdfs.rb | 177 ++++---- lib/rdf/vocab/writer.rb | 66 +-- lib/rdf/vocab/xsd.rb | 498 ++++++++++----------- spec/vocab_writer_spec.rb | 4 +- 5 files changed, 826 insertions(+), 814 deletions(-) diff --git a/lib/rdf/vocab/owl.rb b/lib/rdf/vocab/owl.rb index 4dc3d246..85892218 100644 --- a/lib/rdf/vocab/owl.rb +++ b/lib/rdf/vocab/owl.rb @@ -6,7 +6,12 @@ module RDF # @!parse # # Vocabulary for # # - # # This ontology partially describes the built-in classes and properties that together form the basis of the RDF/XML syntax of OWL 2. The content of this ontology is based on Tables 6.1 and 6.2 in Section 6.4 of the OWL 2 RDF-Based Semantics specification, available at http://www.w3.org/TR/owl2-rdf-based-semantics/. Please note that those tables do not include the different annotations (labels, comments and rdfs:isDefinedBy links) used in this file. Also note that the descriptions provided in this ontology do not provide a complete and correct formal description of either the syntax or the semantics of the introduced terms (please see the OWL 2 recommendations for the complete and normative specifications). Furthermore, the information provided by this ontology may be misleading if not used with care. This ontology SHOULD NOT be imported into OWL ontologies. Importing this file into an OWL 2 DL ontology will cause it to become an OWL 2 Full ontology and may have other, unexpected, consequences. + # # The OWL 2 Schema vocabulary (OWL 2) + # # + # # This ontology partially describes the built-in classes and properties that together form the basis of the RDF/XML syntax of OWL 2. The content of this ontology is based on Tables 6.1 and 6.2 in Section 6.4 of the OWL 2 RDF-Based Semantics specification, available at http://www.w3.org/TR/owl2-rdf-based-semantics/. Please note that those tables do not include the different annotations (labels, comments and rdfs:isDefinedBy links) used in this file. Also note that the descriptions provided in this ontology do not provide a complete and correct formal description of either the syntax or the semantics of the introduced terms (please see the OWL 2 recommendations for the complete and normative specifications). Furthermore, the information provided by this ontology may be misleading if not used with care. This ontology SHOULD NOT be imported into OWL ontologies. Importing this file into an OWL 2 DL ontology will cause it to become an OWL 2 Full ontology and may have other, unexpected, consequences. + # # @version $Date: 2009/11/15 10:54:12 $ + # # @see http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes + # # @see http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties # class OWL < RDF::StrictVocabulary # # The class of collections of pairwise different individuals. # # @return [RDF::Vocabulary::Term] @@ -321,530 +326,530 @@ module RDF # Ontology definition ontology :"http://www.w3.org/2002/07/owl#", - comment: "\r\n This ontology partially describes the built-in classes and\r\n properties that together form the basis of the RDF/XML syntax of OWL 2.\r\n The content of this ontology is based on Tables 6.1 and 6.2\r\n in Section 6.4 of the OWL 2 RDF-Based Semantics specification,\r\n available at http://www.w3.org/TR/owl2-rdf-based-semantics/.\r\n Please note that those tables do not include the different annotations\r\n (labels, comments and rdfs:isDefinedBy links) used in this file.\r\n Also note that the descriptions provided in this ontology do not\r\n provide a complete and correct formal description of either the syntax\r\n or the semantics of the introduced terms (please see the OWL 2\r\n recommendations for the complete and normative specifications).\r\n Furthermore, the information provided by this ontology may be\r\n misleading if not used with care. This ontology SHOULD NOT be imported\r\n into OWL ontologies. Importing this file into an OWL 2 DL ontology\r\n will cause it to become an OWL 2 Full ontology and may have other,\r\n unexpected, consequences.\r\n ".freeze, - "http://purl.org/dc/elements/1.1/title": "The OWL 2 Schema vocabulary (OWL 2)".freeze, - "http://www.w3.org/2000/01/rdf-schema#seeAlso": ["http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes".freeze, "http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties".freeze], - "http://www.w3.org/2002/07/owl#imports": "http://www.w3.org/2000/01/rdf-schema".freeze, - "http://www.w3.org/2002/07/owl#versionIRI": "http://www.w3.org/2002/07/owl".freeze, - "http://www.w3.org/2002/07/owl#versionInfo": "$Date: 2009/11/15 10:54:12 $".freeze, - "http://www.w3.org/2003/g/data-view#namespaceTransformation": "http://dev.w3.org/cvsweb/2009/owl-grddl/owx2rdf.xsl".freeze, - isDefinedBy: ["http://www.w3.org/TR/owl2-mapping-to-rdf/".freeze, "http://www.w3.org/TR/owl2-rdf-based-semantics/".freeze, "http://www.w3.org/TR/owl2-syntax/".freeze], - type: "http://www.w3.org/2002/07/owl#Ontology".freeze + comment: "\r\n This ontology partially describes the built-in classes and\r\n properties that together form the basis of the RDF/XML syntax of OWL 2.\r\n The content of this ontology is based on Tables 6.1 and 6.2\r\n in Section 6.4 of the OWL 2 RDF-Based Semantics specification,\r\n available at http://www.w3.org/TR/owl2-rdf-based-semantics/.\r\n Please note that those tables do not include the different annotations\r\n (labels, comments and rdfs:isDefinedBy links) used in this file.\r\n Also note that the descriptions provided in this ontology do not\r\n provide a complete and correct formal description of either the syntax\r\n or the semantics of the introduced terms (please see the OWL 2\r\n recommendations for the complete and normative specifications).\r\n Furthermore, the information provided by this ontology may be\r\n misleading if not used with care. This ontology SHOULD NOT be imported\r\n into OWL ontologies. Importing this file into an OWL 2 DL ontology\r\n will cause it to become an OWL 2 Full ontology and may have other,\r\n unexpected, consequences.\r\n ", + "http://purl.org/dc/elements/1.1/title": "The OWL 2 Schema vocabulary (OWL 2)", + "http://www.w3.org/2000/01/rdf-schema#seeAlso": ["http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes", "http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties"], + "http://www.w3.org/2002/07/owl#imports": "http://www.w3.org/2000/01/rdf-schema", + "http://www.w3.org/2002/07/owl#versionIRI": "http://www.w3.org/2002/07/owl", + "http://www.w3.org/2002/07/owl#versionInfo": "$Date: 2009/11/15 10:54:12 $", + "http://www.w3.org/2003/g/data-view#namespaceTransformation": "http://dev.w3.org/cvsweb/2009/owl-grddl/owx2rdf.xsl", + isDefinedBy: ["http://www.w3.org/TR/owl2-mapping-to-rdf/", "http://www.w3.org/TR/owl2-rdf-based-semantics/", "http://www.w3.org/TR/owl2-syntax/"], + type: "http://www.w3.org/2002/07/owl#Ontology" # Class definitions term :AllDifferent, - comment: "The class of collections of pairwise different individuals.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "AllDifferent".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of collections of pairwise different individuals.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "AllDifferent", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :AllDisjointClasses, - comment: "The class of collections of pairwise disjoint classes.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "AllDisjointClasses".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of collections of pairwise disjoint classes.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "AllDisjointClasses", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :AllDisjointProperties, - comment: "The class of collections of pairwise disjoint properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "AllDisjointProperties".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of collections of pairwise disjoint properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "AllDisjointProperties", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Annotation, - comment: "The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Annotation".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Annotation", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :AnnotationProperty, - comment: "The class of annotation properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "AnnotationProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of annotation properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "AnnotationProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :AsymmetricProperty, - comment: "The class of asymmetric properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "AsymmetricProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of asymmetric properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "AsymmetricProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Axiom, - comment: "The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Axiom".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Axiom", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Class, - comment: "The class of OWL classes.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Class".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of OWL classes.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Class", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :DataRange, - comment: "The class of OWL data ranges, which are special kinds of datatypes. Note: The use of the IRI owl:DataRange has been deprecated as of OWL 2. The IRI rdfs:Datatype SHOULD be used instead.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "DataRange".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of OWL data ranges, which are special kinds of datatypes. Note: The use of the IRI owl:DataRange has been deprecated as of OWL 2. The IRI rdfs:Datatype SHOULD be used instead.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "DataRange", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Datatype", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :DatatypeProperty, - comment: "The class of data properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "DatatypeProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of data properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "DatatypeProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :DeprecatedClass, - comment: "The class of deprecated classes.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "DeprecatedClass".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of deprecated classes.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "DeprecatedClass", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :DeprecatedProperty, - comment: "The class of deprecated properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "DeprecatedProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of deprecated properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "DeprecatedProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :FunctionalProperty, - comment: "The class of functional properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "FunctionalProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of functional properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "FunctionalProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :InverseFunctionalProperty, - comment: "The class of inverse-functional properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "InverseFunctionalProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of inverse-functional properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "InverseFunctionalProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :IrreflexiveProperty, - comment: "The class of irreflexive properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "IrreflexiveProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of irreflexive properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "IrreflexiveProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :NamedIndividual, - comment: "The class of named individuals.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "NamedIndividual".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of named individuals.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "NamedIndividual", + subClassOf: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :NegativePropertyAssertion, - comment: "The class of negative property assertions.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "NegativePropertyAssertion".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of negative property assertions.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "NegativePropertyAssertion", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Nothing, - comment: "This is the empty class.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Nothing".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/2002/07/owl#Class".freeze + comment: "This is the empty class.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Nothing", + subClassOf: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/2002/07/owl#Class" term :ObjectProperty, - comment: "The class of object properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "ObjectProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of object properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "ObjectProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Ontology, - comment: "The class of ontologies.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Ontology".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of ontologies.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Ontology", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :OntologyProperty, - comment: "The class of ontology properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "OntologyProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of ontology properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "OntologyProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :ReflexiveProperty, - comment: "The class of reflexive properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "ReflexiveProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of reflexive properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "ReflexiveProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Restriction, - comment: "The class of property restrictions.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Restriction".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#Class".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of property restrictions.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Restriction", + subClassOf: "http://www.w3.org/2002/07/owl#Class", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :SymmetricProperty, - comment: "The class of symmetric properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "SymmetricProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of symmetric properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "SymmetricProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Thing, - comment: "The class of OWL individuals.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "Thing".freeze, - type: "http://www.w3.org/2002/07/owl#Class".freeze + comment: "The class of OWL individuals.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "Thing", + type: "http://www.w3.org/2002/07/owl#Class" term :TransitiveProperty, - comment: "The class of transitive properties.".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "TransitiveProperty".freeze, - subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of transitive properties.", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "TransitiveProperty", + subClassOf: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/2000/01/rdf-schema#Class" # Property definitions property :allValuesFrom, - comment: "The property that determines the class that a universal property restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "allValuesFrom".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the class that a universal property restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "allValuesFrom", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :annotatedProperty, - comment: "The property that determines the predicate of an annotated axiom or annotated annotation.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "annotatedProperty".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the predicate of an annotated axiom or annotated annotation.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "annotatedProperty", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :annotatedSource, - comment: "The property that determines the subject of an annotated axiom or annotated annotation.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "annotatedSource".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the subject of an annotated axiom or annotated annotation.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "annotatedSource", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :annotatedTarget, - comment: "The property that determines the object of an annotated axiom or annotated annotation.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "annotatedTarget".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the object of an annotated axiom or annotated annotation.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "annotatedTarget", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :assertionProperty, - comment: "The property that determines the predicate of a negative property assertion.".freeze, - domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "assertionProperty".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the predicate of a negative property assertion.", + domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "assertionProperty", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :backwardCompatibleWith, - comment: "The annotation property that indicates that a given ontology is backward compatible with another ontology.".freeze, - domain: "http://www.w3.org/2002/07/owl#Ontology".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "backwardCompatibleWith".freeze, - range: "http://www.w3.org/2002/07/owl#Ontology".freeze, - type: ["http://www.w3.org/2002/07/owl#AnnotationProperty".freeze, "http://www.w3.org/2002/07/owl#OntologyProperty".freeze] + comment: "The annotation property that indicates that a given ontology is backward compatible with another ontology.", + domain: "http://www.w3.org/2002/07/owl#Ontology", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "backwardCompatibleWith", + range: "http://www.w3.org/2002/07/owl#Ontology", + type: ["http://www.w3.org/2002/07/owl#AnnotationProperty", "http://www.w3.org/2002/07/owl#OntologyProperty"] property :bottomDataProperty, - comment: "The data property that does not relate any individual to any data value.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "bottomDataProperty".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze, - type: "http://www.w3.org/2002/07/owl#DatatypeProperty".freeze + comment: "The data property that does not relate any individual to any data value.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "bottomDataProperty", + range: "http://www.w3.org/2000/01/rdf-schema#Literal", + type: "http://www.w3.org/2002/07/owl#DatatypeProperty" property :bottomObjectProperty, - comment: "The object property that does not relate any two individuals.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "bottomObjectProperty".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze + comment: "The object property that does not relate any two individuals.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "bottomObjectProperty", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/2002/07/owl#ObjectProperty" property :cardinality, - comment: "The property that determines the cardinality of an exact cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "cardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of an exact cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "cardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :complementOf, - comment: "The property that determines that a given class is the complement of another class.".freeze, - domain: "http://www.w3.org/2002/07/owl#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "complementOf".freeze, - range: "http://www.w3.org/2002/07/owl#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that a given class is the complement of another class.", + domain: "http://www.w3.org/2002/07/owl#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "complementOf", + range: "http://www.w3.org/2002/07/owl#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :datatypeComplementOf, - comment: "The property that determines that a given data range is the complement of another data range with respect to the data domain.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "datatypeComplementOf".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that a given data range is the complement of another data range with respect to the data domain.", + domain: "http://www.w3.org/2000/01/rdf-schema#Datatype", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "datatypeComplementOf", + range: "http://www.w3.org/2000/01/rdf-schema#Datatype", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :deprecated, - comment: "The annotation property that indicates that a given entity has been deprecated.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "deprecated".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2002/07/owl#AnnotationProperty".freeze + comment: "The annotation property that indicates that a given entity has been deprecated.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "deprecated", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2002/07/owl#AnnotationProperty" property :differentFrom, - comment: "The property that determines that two given individuals are different.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "differentFrom".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given individuals are different.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "differentFrom", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :disjointUnionOf, - comment: "The property that determines that a given class is equivalent to the disjoint union of a collection of other classes.".freeze, - domain: "http://www.w3.org/2002/07/owl#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "disjointUnionOf".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that a given class is equivalent to the disjoint union of a collection of other classes.", + domain: "http://www.w3.org/2002/07/owl#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "disjointUnionOf", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :disjointWith, - comment: "The property that determines that two given classes are disjoint.".freeze, - domain: "http://www.w3.org/2002/07/owl#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "disjointWith".freeze, - range: "http://www.w3.org/2002/07/owl#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given classes are disjoint.", + domain: "http://www.w3.org/2002/07/owl#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "disjointWith", + range: "http://www.w3.org/2002/07/owl#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :distinctMembers, - comment: "The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom.".freeze, - domain: "http://www.w3.org/2002/07/owl#AllDifferent".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "distinctMembers".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom.", + domain: "http://www.w3.org/2002/07/owl#AllDifferent", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "distinctMembers", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :equivalentClass, - comment: "The property that determines that two given classes are equivalent, and that is used to specify datatype definitions.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "equivalentClass".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given classes are equivalent, and that is used to specify datatype definitions.", + domain: "http://www.w3.org/2000/01/rdf-schema#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "equivalentClass", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :equivalentProperty, - comment: "The property that determines that two given properties are equivalent.".freeze, - domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "equivalentProperty".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given properties are equivalent.", + domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "equivalentProperty", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :hasKey, - comment: "The property that determines the collection of properties that jointly build a key.".freeze, - domain: "http://www.w3.org/2002/07/owl#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "hasKey".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of properties that jointly build a key.", + domain: "http://www.w3.org/2002/07/owl#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "hasKey", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :hasSelf, - comment: "The property that determines the property that a self restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "hasSelf".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the property that a self restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "hasSelf", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :hasValue, - comment: "The property that determines the individual that a has-value restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "hasValue".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the individual that a has-value restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "hasValue", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :imports, - comment: "The property that is used for importing other ontologies into a given ontology.".freeze, - domain: "http://www.w3.org/2002/07/owl#Ontology".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "imports".freeze, - range: "http://www.w3.org/2002/07/owl#Ontology".freeze, - type: "http://www.w3.org/2002/07/owl#OntologyProperty".freeze + comment: "The property that is used for importing other ontologies into a given ontology.", + domain: "http://www.w3.org/2002/07/owl#Ontology", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "imports", + range: "http://www.w3.org/2002/07/owl#Ontology", + type: "http://www.w3.org/2002/07/owl#OntologyProperty" property :incompatibleWith, - comment: "The annotation property that indicates that a given ontology is incompatible with another ontology.".freeze, - domain: "http://www.w3.org/2002/07/owl#Ontology".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "incompatibleWith".freeze, - range: "http://www.w3.org/2002/07/owl#Ontology".freeze, - type: ["http://www.w3.org/2002/07/owl#AnnotationProperty".freeze, "http://www.w3.org/2002/07/owl#OntologyProperty".freeze] + comment: "The annotation property that indicates that a given ontology is incompatible with another ontology.", + domain: "http://www.w3.org/2002/07/owl#Ontology", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "incompatibleWith", + range: "http://www.w3.org/2002/07/owl#Ontology", + type: ["http://www.w3.org/2002/07/owl#AnnotationProperty", "http://www.w3.org/2002/07/owl#OntologyProperty"] property :intersectionOf, - comment: "The property that determines the collection of classes or data ranges that build an intersection.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "intersectionOf".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of classes or data ranges that build an intersection.", + domain: "http://www.w3.org/2000/01/rdf-schema#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "intersectionOf", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :inverseOf, - comment: "The property that determines that two given properties are inverse.".freeze, - domain: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "inverseOf".freeze, - range: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given properties are inverse.", + domain: "http://www.w3.org/2002/07/owl#ObjectProperty", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "inverseOf", + range: "http://www.w3.org/2002/07/owl#ObjectProperty", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :maxCardinality, - comment: "The property that determines the cardinality of a maximum cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "maxCardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of a maximum cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "maxCardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :maxQualifiedCardinality, - comment: "The property that determines the cardinality of a maximum qualified cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "maxQualifiedCardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of a maximum qualified cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "maxQualifiedCardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :members, - comment: "The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "members".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "members", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :minCardinality, - comment: "The property that determines the cardinality of a minimum cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "minCardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of a minimum cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "minCardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :minQualifiedCardinality, - comment: "The property that determines the cardinality of a minimum qualified cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "minQualifiedCardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of a minimum qualified cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "minQualifiedCardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :onClass, - comment: "The property that determines the class that a qualified object cardinality restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "onClass".freeze, - range: "http://www.w3.org/2002/07/owl#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the class that a qualified object cardinality restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "onClass", + range: "http://www.w3.org/2002/07/owl#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :onDataRange, - comment: "The property that determines the data range that a qualified data cardinality restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "onDataRange".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the data range that a qualified data cardinality restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "onDataRange", + range: "http://www.w3.org/2000/01/rdf-schema#Datatype", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :onDatatype, - comment: "The property that determines the datatype that a datatype restriction refers to.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "onDatatype".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the datatype that a datatype restriction refers to.", + domain: "http://www.w3.org/2000/01/rdf-schema#Datatype", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "onDatatype", + range: "http://www.w3.org/2000/01/rdf-schema#Datatype", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :onProperties, - comment: "The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "onProperties".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "onProperties", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :onProperty, - comment: "The property that determines the property that a property restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "onProperty".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the property that a property restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "onProperty", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :oneOf, - comment: "The property that determines the collection of individuals or data values that build an enumeration.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "oneOf".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of individuals or data values that build an enumeration.", + domain: "http://www.w3.org/2000/01/rdf-schema#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "oneOf", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :priorVersion, - comment: "The annotation property that indicates the predecessor ontology of a given ontology.".freeze, - domain: "http://www.w3.org/2002/07/owl#Ontology".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "priorVersion".freeze, - range: "http://www.w3.org/2002/07/owl#Ontology".freeze, - type: ["http://www.w3.org/2002/07/owl#AnnotationProperty".freeze, "http://www.w3.org/2002/07/owl#OntologyProperty".freeze] + comment: "The annotation property that indicates the predecessor ontology of a given ontology.", + domain: "http://www.w3.org/2002/07/owl#Ontology", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "priorVersion", + range: "http://www.w3.org/2002/07/owl#Ontology", + type: ["http://www.w3.org/2002/07/owl#AnnotationProperty", "http://www.w3.org/2002/07/owl#OntologyProperty"] property :propertyChainAxiom, - comment: "The property that determines the n-tuple of properties that build a sub property chain of a given property.".freeze, - domain: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "propertyChainAxiom".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the n-tuple of properties that build a sub property chain of a given property.", + domain: "http://www.w3.org/2002/07/owl#ObjectProperty", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "propertyChainAxiom", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :propertyDisjointWith, - comment: "The property that determines that two given properties are disjoint.".freeze, - domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "propertyDisjointWith".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given properties are disjoint.", + domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "propertyDisjointWith", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :qualifiedCardinality, - comment: "The property that determines the cardinality of an exact qualified cardinality restriction.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "qualifiedCardinality".freeze, - range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the cardinality of an exact qualified cardinality restriction.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "qualifiedCardinality", + range: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :sameAs, - comment: "The property that determines that two given individuals are equal.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "sameAs".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines that two given individuals are equal.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "sameAs", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :someValuesFrom, - comment: "The property that determines the class that an existential property restriction refers to.".freeze, - domain: "http://www.w3.org/2002/07/owl#Restriction".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "someValuesFrom".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the class that an existential property restriction refers to.", + domain: "http://www.w3.org/2002/07/owl#Restriction", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "someValuesFrom", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :sourceIndividual, - comment: "The property that determines the subject of a negative property assertion.".freeze, - domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "sourceIndividual".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the subject of a negative property assertion.", + domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "sourceIndividual", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :targetIndividual, - comment: "The property that determines the object of a negative object property assertion.".freeze, - domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "targetIndividual".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the object of a negative object property assertion.", + domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "targetIndividual", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :targetValue, - comment: "The property that determines the value of a negative data property assertion.".freeze, - domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "targetValue".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the value of a negative data property assertion.", + domain: "http://www.w3.org/2002/07/owl#NegativePropertyAssertion", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "targetValue", + range: "http://www.w3.org/2000/01/rdf-schema#Literal", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :topDataProperty, - comment: "The data property that relates every individual to every data value.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "topDataProperty".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze, - type: "http://www.w3.org/2002/07/owl#DatatypeProperty".freeze + comment: "The data property that relates every individual to every data value.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "topDataProperty", + range: "http://www.w3.org/2000/01/rdf-schema#Literal", + type: "http://www.w3.org/2002/07/owl#DatatypeProperty" property :topObjectProperty, - comment: "The object property that relates every two individuals.".freeze, - domain: "http://www.w3.org/2002/07/owl#Thing".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "topObjectProperty".freeze, - range: "http://www.w3.org/2002/07/owl#Thing".freeze, - type: "http://www.w3.org/2002/07/owl#ObjectProperty".freeze + comment: "The object property that relates every two individuals.", + domain: "http://www.w3.org/2002/07/owl#Thing", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "topObjectProperty", + range: "http://www.w3.org/2002/07/owl#Thing", + type: "http://www.w3.org/2002/07/owl#ObjectProperty" property :unionOf, - comment: "The property that determines the collection of classes or data ranges that build a union.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "unionOf".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of classes or data ranges that build a union.", + domain: "http://www.w3.org/2000/01/rdf-schema#Class", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "unionOf", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :versionIRI, - comment: "The property that identifies the version IRI of an ontology.".freeze, - domain: "http://www.w3.org/2002/07/owl#Ontology".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "versionIRI".freeze, - range: "http://www.w3.org/2002/07/owl#Ontology".freeze, - type: "http://www.w3.org/2002/07/owl#OntologyProperty".freeze + comment: "The property that identifies the version IRI of an ontology.", + domain: "http://www.w3.org/2002/07/owl#Ontology", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "versionIRI", + range: "http://www.w3.org/2002/07/owl#Ontology", + type: "http://www.w3.org/2002/07/owl#OntologyProperty" property :versionInfo, - comment: "The annotation property that provides version information for an ontology or another OWL construct.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "versionInfo".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2002/07/owl#AnnotationProperty".freeze + comment: "The annotation property that provides version information for an ontology or another OWL construct.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "versionInfo", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2002/07/owl#AnnotationProperty" property :withRestrictions, - comment: "The property that determines the collection of facet-value pairs that define a datatype restriction.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze, - isDefinedBy: "http://www.w3.org/2002/07/owl#".freeze, - label: "withRestrictions".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The property that determines the collection of facet-value pairs that define a datatype restriction.", + domain: "http://www.w3.org/2000/01/rdf-schema#Datatype", + isDefinedBy: "http://www.w3.org/2002/07/owl#", + label: "withRestrictions", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" end end diff --git a/lib/rdf/vocab/rdfs.rb b/lib/rdf/vocab/rdfs.rb index 4a15c3cd..b5d3a463 100644 --- a/lib/rdf/vocab/rdfs.rb +++ b/lib/rdf/vocab/rdfs.rb @@ -7,6 +7,7 @@ module RDF # # Vocabulary for # # # # The RDF Schema vocabulary (RDFS) + # # @see http://www.w3.org/2000/01/rdf-schema-more # class RDFS < RDF::StrictVocabulary # # The class of classes. # # @return [RDF::Vocabulary::Term] @@ -16,7 +17,7 @@ module RDF # # @return [RDF::Vocabulary::Term] # attr_reader :Container # - # # The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'. + # # The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'. # # @return [RDF::Vocabulary::Term] # attr_reader :ContainerMembershipProperty # @@ -73,111 +74,111 @@ module RDF # Ontology definition ontology :"http://www.w3.org/2000/01/rdf-schema#", - "http://purl.org/dc/elements/1.1/title": "The RDF Schema vocabulary (RDFS)".freeze, - "http://www.w3.org/2000/01/rdf-schema#seeAlso": "http://www.w3.org/2000/01/rdf-schema-more".freeze, - type: "http://www.w3.org/2002/07/owl#Ontology".freeze + "http://purl.org/dc/elements/1.1/title": "The RDF Schema vocabulary (RDFS)", + "http://www.w3.org/2000/01/rdf-schema#seeAlso": "http://www.w3.org/2000/01/rdf-schema-more", + type: "http://www.w3.org/2002/07/owl#Ontology" # Class definitions term :Class, - comment: "The class of classes.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "Class".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of classes.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "Class", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Container, - comment: "The class of RDF containers.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "Container".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of RDF containers.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "Container", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :ContainerMembershipProperty, - comment: "The class of container membership properties, rdf:_1, rdf:_2, ...,\n all of which are sub-properties of 'member'.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "ContainerMembershipProperty".freeze, - subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of container membership properties, rdf:_1, rdf:_2, ...,\n all of which are sub-properties of 'member'.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "ContainerMembershipProperty", + subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Datatype, - comment: "The class of RDF datatypes.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "Datatype".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of RDF datatypes.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "Datatype", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Literal, - comment: "The class of literal values, eg. textual strings and integers.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "Literal".freeze, - subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class of literal values, eg. textual strings and integers.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "Literal", + subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" term :Resource, - comment: "The class resource, everything.".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "Resource".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze + comment: "The class resource, everything.", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "Resource", + type: "http://www.w3.org/2000/01/rdf-schema#Class" # Property definitions property :comment, - comment: "A description of the subject resource.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "comment".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "A description of the subject resource.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "comment", + range: "http://www.w3.org/2000/01/rdf-schema#Literal", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :domain, - comment: "A domain of the subject property.".freeze, - domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "domain".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "A domain of the subject property.", + domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "domain", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :isDefinedBy, - comment: "The defininition of the subject resource.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "isDefinedBy".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - subPropertyOf: "http://www.w3.org/2000/01/rdf-schema#seeAlso".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The defininition of the subject resource.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "isDefinedBy", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + subPropertyOf: "http://www.w3.org/2000/01/rdf-schema#seeAlso", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :label, - comment: "A human-readable name for the subject.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "label".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "A human-readable name for the subject.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "label", + range: "http://www.w3.org/2000/01/rdf-schema#Literal", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :member, - comment: "A member of the subject resource.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "member".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "A member of the subject resource.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "member", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :range, - comment: "A range of the subject property.".freeze, - domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "range".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "A range of the subject property.", + domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "range", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :seeAlso, - comment: "Further information about the subject resource.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "seeAlso".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "Further information about the subject resource.", + domain: "http://www.w3.org/2000/01/rdf-schema#Resource", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "seeAlso", + range: "http://www.w3.org/2000/01/rdf-schema#Resource", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :subClassOf, - comment: "The subject is a subclass of a class.".freeze, - domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "subClassOf".freeze, - range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The subject is a subclass of a class.", + domain: "http://www.w3.org/2000/01/rdf-schema#Class", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "subClassOf", + range: "http://www.w3.org/2000/01/rdf-schema#Class", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" property :subPropertyOf, - comment: "The subject is a subproperty of a property.".freeze, - domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze, - label: "subPropertyOf".freeze, - range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze, - type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze + comment: "The subject is a subproperty of a property.", + domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#", + label: "subPropertyOf", + range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property", + type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" end end diff --git a/lib/rdf/vocab/writer.rb b/lib/rdf/vocab/writer.rb index 937e0a28..012b48c7 100644 --- a/lib/rdf/vocab/writer.rb +++ b/lib/rdf/vocab/writer.rb @@ -16,40 +16,40 @@ class Format < RDF::Format # # @example a simple term definition # property :comment, - # comment: %(A description of the subject resource.).freeze, - # domain: "rdfs:Resource".freeze, - # label: "comment".freeze, - # range: "rdfs:Literal".freeze, - # isDefinedBy: %(rdfs:).freeze, - # type: "rdf:Property".freeze + # 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".freeze, - # inScheme: "country:iso3166-1-alpha-2".freeze, - # notation: %(ad).freeze + # type: "skos:Concept", + # inScheme: "country:iso3166-1-alpha-2", + # notation: %(ad) # ), term( - # type: "skos:Concept".freeze, - # inScheme: "country:iso3166-1-alpha-3".freeze, - # notation: %(and).freeze + # type: "skos:Concept", + # inScheme: "country:iso3166-1-alpha-3", + # notation: %(and) # )], - # "foaf:name": "Andorra".freeze, - # isDefinedBy: "country:".freeze, - # type: "http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#Country".freeze + # "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).freeze, + # comment: %(The duration of a track or a signal in ms), # domain: term( - # "owl:unionOf": list("mo:Track".freeze, "mo:Signal".freeze), - # type: "owl:Class".freeze + # "owl:unionOf": list("mo:Track", "mo:Signal"), + # type: "owl:Class" # ), - # isDefinedBy: "mo:".freeze, - # "mo:level": "1".freeze, - # range: "xsd:float".freeze, - # type: "owl:DatatypeProperty".freeze, - # "vs:term_status": "testing".freeze + # isDefinedBy: "mo:", + # "mo:level": "1", + # range: "xsd:float", + # type: "owl:DatatypeProperty", + # "vs:term_status": "testing" class Writer < RDF::Writer include RDF::Util::Logger format RDF::Vocabulary::Format @@ -152,10 +152,16 @@ def write_epilogue module #{module_name} ).gsub(/^ /, '') + if @options[:noDoc] + @output.print %( # Vocabulary for <#{base_uri}> + # @!visibility private + ).gsub(/^ /, '') + else @output.print %( # @!parse # # Vocabulary for <#{base_uri}> # # - ).gsub(/^ /, '') unless @options[:noDoc] + ).gsub(/^ /, '') + end if vocab.ontology && !@options[:noDoc] ont_doc = [] @@ -279,26 +285,26 @@ def from_node(name, attributes, term_type) def serialize_value(value, key, indent: "") if value.is_a?(Literal) && %w(: comment definition notation note editorialNote).include?(key.to_s) - "#{value.to_s.inspect}.freeze" + "#{value.to_s.inspect}" elsif value.is_a?(RDF::URI) - "#{value.to_s.inspect}.freeze" + "#{value.to_s.inspect}" elsif value.is_a?(RDF::Vocabulary::Term) value.to_ruby(indent: indent + " ") elsif value.is_a?(RDF::Term) - "#{value.to_s.inspect}.freeze" + "#{value.to_s.inspect}" elsif value.is_a?(RDF::List) list_elements = value.map do |u| if u.uri? - "#{u.to_s.inspect}.freeze" + "#{u.to_s.inspect}" elsif u.respond_to?(:to_ruby) u.to_ruby(indent: indent + " ") else - "#{u.to_s.inspect}.freeze" + "#{u.to_s.inspect}" end end "list(#{list_elements.join(', ')})" else - "#{value.inspect}.freeze" + "#{value.inspect}" end end end diff --git a/lib/rdf/vocab/xsd.rb b/lib/rdf/vocab/xsd.rb index 7e6fc1a0..6b3073a0 100644 --- a/lib/rdf/vocab/xsd.rb +++ b/lib/rdf/vocab/xsd.rb @@ -7,203 +7,203 @@ module RDF # # Vocabulary for # # # class XSD < RDF::Vocabulary - # # ENTITIES represents the ENTITIES attribute type from [XML]. The ·value space· of ENTITIES is the set of finite, non-zero-length sequences of ·ENTITY· values that have been declared as unparsed entities in a document type definition. The ·lexical space· of ENTITIES is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of ENTITY. The ·item type· of ENTITIES is ENTITY. ENTITIES is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is ENTITY; this is the ·base type· of ENTITIES, which restricts its value space to lists with at least one item. + # # ENTITIES represents the ENTITIES attribute type from [XML]. The ·value space· of ENTITIES is the set of finite, non-zero-length sequences of ·ENTITY· values that have been declared as unparsed entities in a document type definition. The ·lexical space· of ENTITIES is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of ENTITY. The ·item type· of ENTITIES is ENTITY. ENTITIES is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is ENTITY; this is the ·base type· of ENTITIES, which restricts its value space to lists with at least one item. # # @return [RDF::Vocabulary::Term] # attr_reader :ENTITIES # - # # ENTITY represents the ENTITY attribute type from [XML]. The ·value space· of ENTITY is the set of all strings that ·match· the NCName production in [Namespaces in XML] and have been declared as an unparsed entity in a document type definition. The ·lexical space· of ENTITY is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ENTITY is NCName. + # # ENTITY represents the ENTITY attribute type from [XML]. The ·value space· of ENTITY is the set of all strings that ·match· the NCName production in [Namespaces in XML] and have been declared as an unparsed entity in a document type definition. The ·lexical space· of ENTITY is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ENTITY is NCName. # # @return [RDF::Vocabulary::Term] # attr_reader :ENTITY # - # # ID represents the ID attribute type from [XML]. The ·value space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·lexical space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ID is NCName. + # # ID represents the ID attribute type from [XML]. The ·value space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·lexical space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ID is NCName. # # @return [RDF::Vocabulary::Term] # attr_reader :ID # - # # IDREF represents the IDREF attribute type from [XML]. The ·value space· of IDREF is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·lexical space· of IDREF is the set of strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of IDREF is NCName. + # # IDREF represents the IDREF attribute type from [XML]. The ·value space· of IDREF is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·lexical space· of IDREF is the set of strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of IDREF is NCName. # # @return [RDF::Vocabulary::Term] # attr_reader :IDREF # - # # IDREFS represents the IDREFS attribute type from [XML]. The ·value space· of IDREFS is the set of finite, non-zero-length sequences of IDREFs. The ·lexical space· of IDREFS is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of IDREF. The ·item type· of IDREFS is IDREF. IDREFS is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is IDREF; this is the ·base type· of IDREFS, which restricts its value space to lists with at least one item. + # # IDREFS represents the IDREFS attribute type from [XML]. The ·value space· of IDREFS is the set of finite, non-zero-length sequences of IDREFs. The ·lexical space· of IDREFS is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of IDREF. The ·item type· of IDREFS is IDREF. IDREFS is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is IDREF; this is the ·base type· of IDREFS, which restricts its value space to lists with at least one item. # # @return [RDF::Vocabulary::Term] # attr_reader :IDREFS # - # # NCName represents XML "non-colonized" Names. The ·value space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·lexical space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·base type· of NCName is Name. + # # NCName represents XML "non-colonized" Names. The ·value space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·lexical space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·base type· of NCName is Name. # # @return [RDF::Vocabulary::Term] # attr_reader :NCName # - # # NMTOKEN represents the NMTOKEN attribute type from [XML]. The ·value space· of NMTOKEN is the set of tokens that ·match· the Nmtoken production in [XML]. The ·lexical space· of NMTOKEN is the set of strings that ·match· the Nmtoken production in [XML]. The ·base type· of NMTOKEN is token. + # # NMTOKEN represents the NMTOKEN attribute type from [XML]. The ·value space· of NMTOKEN is the set of tokens that ·match· the Nmtoken production in [XML]. The ·lexical space· of NMTOKEN is the set of strings that ·match· the Nmtoken production in [XML]. The ·base type· of NMTOKEN is token. # # @return [RDF::Vocabulary::Term] # attr_reader :NMTOKEN # - # # NMTOKENS represents the NMTOKENS attribute type from [XML]. The ·value space· of NMTOKENS is the set of finite, non-zero-length sequences of ·NMTOKEN·s. The ·lexical space· of NMTOKENS is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of NMTOKEN. The ·item type· of NMTOKENS is NMTOKEN. NMTOKENS is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is NMTOKEN; this is the ·base type· of NMTOKENS, which restricts its value space to lists with at least one item. + # # NMTOKENS represents the NMTOKENS attribute type from [XML]. The ·value space· of NMTOKENS is the set of finite, non-zero-length sequences of ·NMTOKEN·s. The ·lexical space· of NMTOKENS is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of NMTOKEN. The ·item type· of NMTOKENS is NMTOKEN. NMTOKENS is derived from ·anySimpleType· in two steps: an anonymous list type is defined, whose ·item type· is NMTOKEN; this is the ·base type· of NMTOKENS, which restricts its value space to lists with at least one item. # # @return [RDF::Vocabulary::Term] # attr_reader :NMTOKENS # - # # NOTATION represents the NOTATION attribute type from [XML]. The ·value space· of NOTATION is the set of QNames of notations declared in the current schema. The ·lexical space· of NOTATION is the set of all names of notations declared in the current schema (in the form of QNames). + # # NOTATION represents the NOTATION attribute type from [XML]. The ·value space· of NOTATION is the set of QNames of notations declared in the current schema. The ·lexical space· of NOTATION is the set of all names of notations declared in the current schema (in the form of QNames). # # @return [RDF::Vocabulary::Term] # attr_reader :NOTATION # - # # Name represents XML Names. The ·value space· of Name is the set of all strings which ·match· the Name production of [XML]. The ·lexical space· of Name is the set of all strings which ·match· the Name production of [XML]. The ·base type· of Name is token. + # # Name represents XML Names. The ·value space· of Name is the set of all strings which ·match· the Name production of [XML]. The ·lexical space· of Name is the set of all strings which ·match· the Name production of [XML]. The ·base type· of Name is token. # # @return [RDF::Vocabulary::Term] # attr_reader :Name # - # # QName represents XML qualified names. The ·value space· of QName is the set of tuples `{namespace name, local part}`, where namespace name is an anyURI and local part is an NCName. The ·lexical space· of QName is the set of strings that ·match· the QName production of [Namespaces in XML]. + # # QName represents XML qualified names. The ·value space· of QName is the set of tuples {namespace name, local part}, where namespace name is an anyURI and local part is an NCName. The ·lexical space· of QName is the set of strings that ·match· the QName production of [Namespaces in XML]. # # @return [RDF::Vocabulary::Term] # attr_reader :QName # - # # anyAtomicType is a special ·restriction· of anySimpleType. The ·value· and ·lexical spaces· of anyAtomicType are the unions of the ·value· and ·lexical spaces· of all the ·primitive· datatypes, and anyAtomicType is their ·base type·. + # # anyAtomicType is a special ·restriction· of anySimpleType. The ·value· and ·lexical spaces· of anyAtomicType are the unions of the ·value· and ·lexical spaces· of all the ·primitive· datatypes, and anyAtomicType is their ·base type·. # # @return [RDF::Vocabulary::Term] # attr_reader :anyAtomicType # - # # The definition of anySimpleType is a special ·restriction· of anyType. The ·lexical space· of anySimpleType is the set of all sequences of Unicode characters, and its ·value space· includes all ·atomic values· and all finite-length lists of zero or more ·atomic values·. + # # The definition of anySimpleType is a special ·restriction· of anyType. The ·lexical space· of anySimpleType is the set of all sequences of Unicode characters, and its ·value space· includes all ·atomic values· and all finite-length lists of zero or more ·atomic values·. # # @return [RDF::Vocabulary::Term] # attr_reader :anySimpleType # - # # The root of the [XML Schema 1.1] datatype heirarchy. + # # The root of the [XML Schema 1.1] datatype heirarchy. # # @return [RDF::Vocabulary::Term] # attr_reader :anyType # - # # anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. + # # anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. # # @return [RDF::Vocabulary::Term] # attr_reader :anyURI # - # # base64Binary represents arbitrary Base64-encoded binary data. For base64Binary data the entire binary stream is encoded using the Base64 Encoding defined in [RFC 3548], which is derived from the encoding described in [RFC 2045]. + # # base64Binary represents arbitrary Base64-encoded binary data. For base64Binary data the entire binary stream is encoded using the Base64 Encoding defined in [RFC 3548], which is derived from the encoding described in [RFC 2045]. # # @return [RDF::Vocabulary::Term] # attr_reader :base64Binary # - # # boolean represents the values of two-valued logic. + # # boolean represents the values of two-valued logic. # # @return [RDF::Vocabulary::Term] # attr_reader :boolean # - # # byte is ·derived· from short by setting the value of ·maxInclusive· to be 127 and ·minInclusive· to be -128. The ·base type· of byte is short. + # # byte is ·derived· from short by setting the value of ·maxInclusive· to be 127 and ·minInclusive· to be -128. The ·base type· of byte is short. # # @return [RDF::Vocabulary::Term] # attr_reader :byte # - # # date represents top-open intervals of exactly one day in length on the timelines of dateTime, beginning on the beginning moment of each day, up to but not including the beginning moment of the next day). For non-timezoned values, the top-open intervals disjointly cover the non-timezoned timeline, one per day. For timezoned values, the intervals begin at every minute and therefore overlap. + # # date represents top-open intervals of exactly one day in length on the timelines of dateTime, beginning on the beginning moment of each day, up to but not including the beginning moment of the next day). For non-timezoned values, the top-open intervals disjointly cover the non-timezoned timeline, one per day. For timezoned values, the intervals begin at every minute and therefore overlap. # # @return [RDF::Vocabulary::Term] # attr_reader :date # - # # dateTime represents instants of time, optionally marked with a particular time zone offset. Values representing the same instant but having different time zone offsets are equal but not identical. + # # dateTime represents instants of time, optionally marked with a particular time zone offset. Values representing the same instant but having different time zone offsets are equal but not identical. # # @return [RDF::Vocabulary::Term] # attr_reader :dateTime # - # # The dateTimeStamp datatype is ·derived· from dateTime by giving the value required to its explicitTimezone facet. The result is that all values of dateTimeStamp are required to have explicit time zone offsets and the datatype is totally ordered. + # # The dateTimeStamp datatype is ·derived· from dateTime by giving the value required to its explicitTimezone facet. The result is that all values of dateTimeStamp are required to have explicit time zone offsets and the datatype is totally ordered. # # @return [RDF::Vocabulary::Term] # attr_reader :dateTimeStamp # - # # dayTimeDuration is a datatype ·derived· from duration by restricting its ·lexical representations· to instances of dayTimeDurationLexicalRep. The ·value space· of dayTimeDuration is therefore that of duration restricted to those whose ·months· property is 0. This results in a duration datatype which is totally ordered. + # # dayTimeDuration is a datatype ·derived· from duration by restricting its ·lexical representations· to instances of dayTimeDurationLexicalRep. The ·value space· of dayTimeDuration is therefore that of duration restricted to those whose ·months· property is 0. This results in a duration datatype which is totally ordered. # # @return [RDF::Vocabulary::Term] # attr_reader :dayTimeDuration # - # # decimal represents a subset of the real numbers, which can be represented by decimal numerals. The ·value space· of decimal is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten, i.e., expressible as i / 10n where i and n are integers and n ≥ 0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The order relation on decimal is the order relation on real numbers, restricted to this subset. + # # decimal represents a subset of the real numbers, which can be represented by decimal numerals. The ·value space· of decimal is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten, i.e., expressible as i / 10n where i and n are integers and n ≥ 0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The order relation on decimal is the order relation on real numbers, restricted to this subset. # # @return [RDF::Vocabulary::Term] # attr_reader :decimal # - # # The double datatype is patterned after the IEEE double-precision 64-bit floating point datatype [IEEE 754-2008]. Each floating point datatype has a value space that is a subset of the rational numbers. Floating point numbers are often used to approximate arbitrary real numbers. + # # The double datatype is patterned after the IEEE double-precision 64-bit floating point datatype [IEEE 754-2008]. Each floating point datatype has a value space that is a subset of the rational numbers. Floating point numbers are often used to approximate arbitrary real numbers. # # @return [RDF::Vocabulary::Term] # attr_reader :double # - # # duration is a datatype that represents durations of time. The concept of duration being captured is drawn from those of [ISO 8601], specifically durations without fixed endpoints. For example, "15 days" (whose most common lexical representation in duration is "'P15D'") is a duration value; "15 days beginning 12 July 1995" and "15 days ending 12 July 1995" are not duration values. duration can provide addition and subtraction operations between duration values and between duration/dateTime value pairs, and can be the result of subtracting dateTime values. However, only addition to dateTime is required for XML Schema processing and is defined in the function ·dateTimePlusDuration·. + # # duration is a datatype that represents durations of time. The concept of duration being captured is drawn from those of [ISO 8601], specifically durations without fixed endpoints. For example, "15 days" (whose most common lexical representation in duration is "'P15D'") is a duration value; "15 days beginning 12 July 1995" and "15 days ending 12 July 1995" are not duration values. duration can provide addition and subtraction operations between duration values and between duration/dateTime value pairs, and can be the result of subtracting dateTime values. However, only addition to dateTime is required for XML Schema processing and is defined in the function ·dateTimePlusDuration·. # # @return [RDF::Vocabulary::Term] # attr_reader :duration # - # # The float datatype is patterned after the IEEE single-precision 32-bit floating point datatype [IEEE 754-2008]. Its value space is a subset of the rational numbers. Floating point numbers are often used to approximate arbitrary real numbers. + # # The float datatype is patterned after the IEEE single-precision 32-bit floating point datatype [IEEE 754-2008]. Its value space is a subset of the rational numbers. Floating point numbers are often used to approximate arbitrary real numbers. # # @return [RDF::Vocabulary::Term] # attr_reader :float # - # # gDay represents whole days within an arbitrary month—days that recur at the same point in each (Gregorian) month. This datatype is used to represent a specific day of the month. To indicate, for example, that an employee gets a paycheck on the 15th of each month. (Obviously, days beyond 28 cannot occur in all months; they are nonetheless permitted, up to 31.) + # # gDay represents whole days within an arbitrary month—days that recur at the same point in each (Gregorian) month. This datatype is used to represent a specific day of the month. To indicate, for example, that an employee gets a paycheck on the 15th of each month. (Obviously, days beyond 28 cannot occur in all months; they are nonetheless permitted, up to 31.) # # @return [RDF::Vocabulary::Term] # attr_reader :gDay # - # # gMonth represents whole (Gregorian) months within an arbitrary year—months that recur at the same point in each year. It might be used, for example, to say what month annual Thanksgiving celebrations fall in different countries (--11 in the United States, --10 in Canada, and possibly other months in other countries). + # # gMonth represents whole (Gregorian) months within an arbitrary year—months that recur at the same point in each year. It might be used, for example, to say what month annual Thanksgiving celebrations fall in different countries (--11 in the United States, --10 in Canada, and possibly other months in other countries). # # @return [RDF::Vocabulary::Term] # attr_reader :gMonth # - # # gMonthDay represents whole calendar days that recur at the same point in each calendar year, or that occur in some arbitrary calendar year. (Obviously, days beyond 28 cannot occur in all Februaries; 29 is nonetheless permitted.) + # # gMonthDay represents whole calendar days that recur at the same point in each calendar year, or that occur in some arbitrary calendar year. (Obviously, days beyond 28 cannot occur in all Februaries; 29 is nonetheless permitted.) # # @return [RDF::Vocabulary::Term] # attr_reader :gMonthDay # - # # gYear represents Gregorian calendar years. + # # gYear represents Gregorian calendar years. # # @return [RDF::Vocabulary::Term] # attr_reader :gYear # - # # gYearMonth represents specific whole Gregorian months in specific Gregorian years. + # # gYearMonth represents specific whole Gregorian months in specific Gregorian years. # # @return [RDF::Vocabulary::Term] # attr_reader :gYearMonth # - # # hexBinary represents arbitrary hex-encoded binary data. + # # hexBinary represents arbitrary hex-encoded binary data. # # @return [RDF::Vocabulary::Term] # attr_reader :hexBinary # - # # int is ·derived· from long by setting the value of ·maxInclusive· to be 2147483647 and ·minInclusive· to be -2147483648. The ·base type· of int is long. + # # int is ·derived· from long by setting the value of ·maxInclusive· to be 2147483647 and ·minInclusive· to be -2147483648. The ·base type· of int is long. # # @return [RDF::Vocabulary::Term] # attr_reader :int # - # # integer is ·derived· from decimal by fixing the value of ·fractionDigits· to be 0 and disallowing the trailing decimal point. This results in the standard mathematical concept of the integer numbers. The ·value space· of integer is the infinite set `{...,-2,-1,0,1,2,...}`. The ·base type· of integer is decimal. + # # integer is ·derived· from decimal by fixing the value of ·fractionDigits· to be 0 and disallowing the trailing decimal point. This results in the standard mathematical concept of the integer numbers. The ·value space· of integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of integer is decimal. # # @return [RDF::Vocabulary::Term] # attr_reader :integer # - # # language represents formal natural language identifiers, as defined by [BCP 47] (currently represented by [RFC 4646] and [RFC 4647]) or its successor(s). The ·value space· and ·lexical space· of language are the set of all strings that conform to the pattern `[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*` + # # language represents formal natural language identifiers, as defined by [BCP 47] (currently represented by [RFC 4646] and [RFC 4647]) or its successor(s). The ·value space· and ·lexical space· of language are the set of all strings that conform to the pattern [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})* # # @return [RDF::Vocabulary::Term] # attr_reader :language # - # # long is ·derived· from integer by setting the value of ·maxInclusive· to be 9223372036854775807 and ·minInclusive· to be -9223372036854775808. The ·base type· of long is integer. + # # long is ·derived· from integer by setting the value of ·maxInclusive· to be 9223372036854775807 and ·minInclusive· to be -9223372036854775808. The ·base type· of long is integer. # # @return [RDF::Vocabulary::Term] # attr_reader :long # - # # negativeInteger is ·derived· from nonPositiveInteger by setting the value of ·maxInclusive· to be -1. This results in the standard mathematical concept of the negative integers. The ·value space· of negativeInteger is the infinite set `{...,-2,-1}`. The ·base type· of negativeInteger is nonPositiveInteger. + # # negativeInteger is ·derived· from nonPositiveInteger by setting the value of ·maxInclusive· to be -1. This results in the standard mathematical concept of the negative integers. The ·value space· of negativeInteger is the infinite set {...,-2,-1}. The ·base type· of negativeInteger is nonPositiveInteger. # # @return [RDF::Vocabulary::Term] # attr_reader :negativeInteger # - # # nonNegativeInteger is ·derived· from integer by setting the value of ·minInclusive· to be 0. This results in the standard mathematical concept of the non-negative integers. The ·value space· of nonNegativeInteger is the infinite set `{0,1,2,...}`. The ·base type· of nonNegativeInteger is integer. + # # nonNegativeInteger is ·derived· from integer by setting the value of ·minInclusive· to be 0. This results in the standard mathematical concept of the non-negative integers. The ·value space· of nonNegativeInteger is the infinite set {0,1,2,...}. The ·base type· of nonNegativeInteger is integer. # # @return [RDF::Vocabulary::Term] # attr_reader :nonNegativeInteger # - # # nonPositiveInteger is ·derived· from integer by setting the value of ·maxInclusive· to be 0. This results in the standard mathematical concept of the non-positive integers. The ·value space· of nonPositiveInteger is the infinite set `{...,-2,-1,0}`. The ·base type· of nonPositiveInteger is integer. + # # nonPositiveInteger is ·derived· from integer by setting the value of ·maxInclusive· to be 0. This results in the standard mathematical concept of the non-positive integers. The ·value space· of nonPositiveInteger is the infinite set {...,-2,-1,0}. The ·base type· of nonPositiveInteger is integer. # # @return [RDF::Vocabulary::Term] # attr_reader :nonPositiveInteger # - # # normalizedString represents white space normalized strings. The ·value space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·lexical space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·base type· of normalizedString is string. + # # normalizedString represents white space normalized strings. The ·value space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·lexical space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·base type· of normalizedString is string. # # @return [RDF::Vocabulary::Term] # attr_reader :normalizedString # - # # positiveInteger is ·derived· from nonNegativeInteger by setting the value of ·minInclusive· to be 1. This results in the standard mathematical concept of the positive integer numbers. The ·value space· of positiveInteger is the infinite set `{1,2,...}`. The ·base type· of positiveInteger is nonNegativeInteger. + # # positiveInteger is ·derived· from nonNegativeInteger by setting the value of ·minInclusive· to be 1. This results in the standard mathematical concept of the positive integer numbers. The ·value space· of positiveInteger is the infinite set {1,2,...}. The ·base type· of positiveInteger is nonNegativeInteger. # # @return [RDF::Vocabulary::Term] # attr_reader :positiveInteger # - # # short is ·derived· from int by setting the value of ·maxInclusive· to be 32767 and ·minInclusive· to be -32768. The ·base type· of short is int. + # # short is ·derived· from int by setting the value of ·maxInclusive· to be 32767 and ·minInclusive· to be -32768. The ·base type· of short is int. # # @return [RDF::Vocabulary::Term] # attr_reader :short # - # # The string datatype represents character strings in XML. + # # The string datatype represents character strings in XML. # # @return [RDF::Vocabulary::Term] # attr_reader :string # - # # time represents instants of time that recur at the same point in each calendar day, or that occur in some arbitrary calendar day. + # # time represents instants of time that recur at the same point in each calendar day, or that occur in some arbitrary calendar day. # # @return [RDF::Vocabulary::Term] # attr_reader :time # - # # token represents tokenized strings. The ·value space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·lexical space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·base type· of token is normalizedString. + # # token represents tokenized strings. The ·value space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·lexical space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·base type· of token is normalizedString. # # @return [RDF::Vocabulary::Term] # attr_reader :token # - # # nsignedByte is ·derived· from unsignedShort by setting the value of ·maxInclusive· to be 255. The ·base type· of unsignedByte is unsignedShort. + # # nsignedByte is ·derived· from unsignedShort by setting the value of ·maxInclusive· to be 255. The ·base type· of unsignedByte is unsignedShort. # # @return [RDF::Vocabulary::Term] # attr_reader :unsignedByte # - # # unsignedInt is ·derived· from unsignedLong by setting the value of ·maxInclusive· to be 4294967295. The ·base type· of unsignedInt is unsignedLong. + # # unsignedInt is ·derived· from unsignedLong by setting the value of ·maxInclusive· to be 4294967295. The ·base type· of unsignedInt is unsignedLong. # # @return [RDF::Vocabulary::Term] # attr_reader :unsignedInt # - # # unsignedLong is ·derived· from nonNegativeInteger by setting the value of ·maxInclusive· to be 18446744073709551615. The ·base type· of unsignedLong is nonNegativeInteger. + # # unsignedLong is ·derived· from nonNegativeInteger by setting the value of ·maxInclusive· to be 18446744073709551615. The ·base type· of unsignedLong is nonNegativeInteger. # # @return [RDF::Vocabulary::Term] # attr_reader :unsignedLong # - # # unsignedShort is ·derived· from unsignedInt by setting the value of ·maxInclusive· to be 65535. The ·base type· of unsignedShort is unsignedInt. + # # unsignedShort is ·derived· from unsignedInt by setting the value of ·maxInclusive· to be 65535. The ·base type· of unsignedShort is unsignedInt. # # @return [RDF::Vocabulary::Term] # attr_reader :unsignedShort # - # # yearMonthDuration is a datatype ·derived· from duration by restricting its ·lexical representations· to instances of yearMonthDurationLexicalRep. The ·value space· of yearMonthDuration is therefore that of duration restricted to those whose ·seconds· property is 0. This results in a duration datatype which is totally ordered. + # # yearMonthDuration is a datatype ·derived· from duration by restricting its ·lexical representations· to instances of yearMonthDurationLexicalRep. The ·value space· of yearMonthDuration is therefore that of duration restricted to those whose ·seconds· property is 0. This results in a duration datatype which is totally ordered. # # @return [RDF::Vocabulary::Term] # attr_reader :yearMonthDuration # @@ -212,253 +212,253 @@ module RDF # Datatype definitions term :ENTITIES, - comment: "\n ENTITIES represents the ENTITIES attribute type from [XML]. The ·value\n space· of ENTITIES is the set of finite, non-zero-length sequences of\n ·ENTITY· values that have been declared as unparsed entities in a document\n type definition. The ·lexical space· of ENTITIES is the set of\n space-separated lists of tokens, of which each token is in the ·lexical\n space· of ENTITY. The ·item type· of ENTITIES is ENTITY. ENTITIES is\n derived from ·anySimpleType· in two steps: an anonymous list type is\n defined, whose ·item type· is ENTITY; this is the ·base type· of ENTITIES,\n which restricts its value space to lists with at least one item.\n ".freeze, - label: "ENTITIES".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n ENTITIES represents the ENTITIES attribute type from [XML]. The ·value\n space· of ENTITIES is the set of finite, non-zero-length sequences of\n ·ENTITY· values that have been declared as unparsed entities in a document\n type definition. The ·lexical space· of ENTITIES is the set of\n space-separated lists of tokens, of which each token is in the ·lexical\n space· of ENTITY. The ·item type· of ENTITIES is ENTITY. ENTITIES is\n derived from ·anySimpleType· in two steps: an anonymous list type is\n defined, whose ·item type· is ENTITY; this is the ·base type· of ENTITIES,\n which restricts its value space to lists with at least one item.\n ", + label: "ENTITIES", + subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :ENTITY, - comment: "\n ENTITY represents the ENTITY attribute type from [XML]. The ·value space·\n of ENTITY is the set of all strings that ·match· the NCName production in\n [Namespaces in XML] and have been declared as an unparsed entity in a\n document type definition. The ·lexical space· of ENTITY is the set of all\n strings that ·match· the NCName production in [Namespaces in XML]. The\n ·base type· of ENTITY is NCName.\n ".freeze, - label: "ENTITY".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#NCName".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n ENTITY represents the ENTITY attribute type from [XML]. The ·value space·\n of ENTITY is the set of all strings that ·match· the NCName production in\n [Namespaces in XML] and have been declared as an unparsed entity in a\n document type definition. The ·lexical space· of ENTITY is the set of all\n strings that ·match· the NCName production in [Namespaces in XML]. The\n ·base type· of ENTITY is NCName.\n ", + label: "ENTITY", + subClassOf: "http://www.w3.org/2001/XMLSchema#NCName", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :ID, - comment: "\n ID represents the ID attribute type from [XML]. The ·value space· of ID is\n the set of all strings that ·match· the NCName production in [Namespaces\n in XML]. The ·lexical space· of ID is the set of all strings that ·match·\n the NCName production in [Namespaces in XML]. The ·base type· of ID is\n NCName.\n ".freeze, - label: "ID".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#NCName".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n ID represents the ID attribute type from [XML]. The ·value space· of ID is\n the set of all strings that ·match· the NCName production in [Namespaces\n in XML]. The ·lexical space· of ID is the set of all strings that ·match·\n the NCName production in [Namespaces in XML]. The ·base type· of ID is\n NCName.\n ", + label: "ID", + subClassOf: "http://www.w3.org/2001/XMLSchema#NCName", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :IDREF, - comment: "\n IDREF represents the IDREF attribute type from [XML]. The ·value space· of\n IDREF is the set of all strings that ·match· the NCName production in\n [Namespaces in XML]. The ·lexical space· of IDREF is the set of strings\n that ·match· the NCName production in [Namespaces in XML]. The ·base type·\n of IDREF is NCName.\n ".freeze, - label: "IDREF".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#NCName".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n IDREF represents the IDREF attribute type from [XML]. The ·value space· of\n IDREF is the set of all strings that ·match· the NCName production in\n [Namespaces in XML]. The ·lexical space· of IDREF is the set of strings\n that ·match· the NCName production in [Namespaces in XML]. The ·base type·\n of IDREF is NCName.\n ", + label: "IDREF", + subClassOf: "http://www.w3.org/2001/XMLSchema#NCName", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :IDREFS, - comment: "\n IDREFS represents the IDREFS attribute type from [XML]. The ·value space·\n of IDREFS is the set of finite, non-zero-length sequences of IDREFs. The\n ·lexical space· of IDREFS is the set of space-separated lists of tokens, of\n which each token is in the ·lexical space· of IDREF. The ·item type· of\n IDREFS is IDREF. IDREFS is derived from ·anySimpleType· in two steps: an\n anonymous list type is defined, whose ·item type· is IDREF; this is the\n ·base type· of IDREFS, which restricts its value space to lists with at\n least one item.\n ".freeze, - label: "IDREFS".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n IDREFS represents the IDREFS attribute type from [XML]. The ·value space·\n of IDREFS is the set of finite, non-zero-length sequences of IDREFs. The\n ·lexical space· of IDREFS is the set of space-separated lists of tokens, of\n which each token is in the ·lexical space· of IDREF. The ·item type· of\n IDREFS is IDREF. IDREFS is derived from ·anySimpleType· in two steps: an\n anonymous list type is defined, whose ·item type· is IDREF; this is the\n ·base type· of IDREFS, which restricts its value space to lists with at\n least one item.\n ", + label: "IDREFS", + subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :NCName, - comment: "\n NCName represents XML \"non-colonized\" Names. The ·value space· of NCName\n is the set of all strings which ·match· the NCName production of\n [Namespaces in XML]. The ·lexical space· of NCName is the set of all\n strings which ·match· the NCName production of [Namespaces in XML]. The\n ·base type· of NCName is Name.\n ".freeze, - label: "NCName".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#Name".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n NCName represents XML \"non-colonized\" Names. The ·value space· of NCName\n is the set of all strings which ·match· the NCName production of\n [Namespaces in XML]. The ·lexical space· of NCName is the set of all\n strings which ·match· the NCName production of [Namespaces in XML]. The\n ·base type· of NCName is Name.\n ", + label: "NCName", + subClassOf: "http://www.w3.org/2001/XMLSchema#Name", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :NMTOKEN, - comment: "\n NMTOKEN represents the NMTOKEN attribute type from [XML]. The ·value\n space· of NMTOKEN is the set of tokens that ·match· the Nmtoken production\n in [XML]. The ·lexical space· of NMTOKEN is the set of strings that\n ·match· the Nmtoken production in [XML]. The ·base type· of NMTOKEN is\n token.\n ".freeze, - label: "NMTOKEN".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#token".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n NMTOKEN represents the NMTOKEN attribute type from [XML]. The ·value\n space· of NMTOKEN is the set of tokens that ·match· the Nmtoken production\n in [XML]. The ·lexical space· of NMTOKEN is the set of strings that\n ·match· the Nmtoken production in [XML]. The ·base type· of NMTOKEN is\n token.\n ", + label: "NMTOKEN", + subClassOf: "http://www.w3.org/2001/XMLSchema#token", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :NMTOKENS, - comment: "\n NMTOKENS represents the NMTOKENS attribute type from [XML]. The ·value\n space· of NMTOKENS is the set of finite, non-zero-length sequences of\n ·NMTOKEN·s. The ·lexical space· of NMTOKENS is the set of space-separated\n lists of tokens, of which each token is in the ·lexical space· of NMTOKEN.\n The ·item type· of NMTOKENS is NMTOKEN. NMTOKENS is derived from\n ·anySimpleType· in two steps: an anonymous list type is defined, whose\n ·item type· is NMTOKEN; this is the ·base type· of NMTOKENS, which\n restricts its value space to lists with at least one item.\n ".freeze, - label: "NMTOKENS".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n NMTOKENS represents the NMTOKENS attribute type from [XML]. The ·value\n space· of NMTOKENS is the set of finite, non-zero-length sequences of\n ·NMTOKEN·s. The ·lexical space· of NMTOKENS is the set of space-separated\n lists of tokens, of which each token is in the ·lexical space· of NMTOKEN.\n The ·item type· of NMTOKENS is NMTOKEN. NMTOKENS is derived from\n ·anySimpleType· in two steps: an anonymous list type is defined, whose\n ·item type· is NMTOKEN; this is the ·base type· of NMTOKENS, which\n restricts its value space to lists with at least one item.\n ", + label: "NMTOKENS", + subClassOf: "http://www.w3.org/2001/XMLSchema#anySimpleType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :NOTATION, - comment: "\n NOTATION represents the NOTATION attribute type from [XML]. The ·value\n space· of NOTATION is the set of QNames of notations declared in the\n current schema. The ·lexical space· of NOTATION is the set of all names of\n notations declared in the current schema (in the form of QNames).\n ".freeze, - label: "NOTATION".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n NOTATION represents the NOTATION attribute type from [XML]. The ·value\n space· of NOTATION is the set of QNames of notations declared in the\n current schema. The ·lexical space· of NOTATION is the set of all names of\n notations declared in the current schema (in the form of QNames).\n ", + label: "NOTATION", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :Name, - comment: "\n Name represents XML Names. The ·value space· of Name is the set of all\n strings which ·match· the Name production of [XML]. The ·lexical space· of\n Name is the set of all strings which ·match· the Name production of [XML].\n The ·base type· of Name is token.\n ".freeze, - label: "Name".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#token".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n Name represents XML Names. The ·value space· of Name is the set of all\n strings which ·match· the Name production of [XML]. The ·lexical space· of\n Name is the set of all strings which ·match· the Name production of [XML].\n The ·base type· of Name is token.\n ", + label: "Name", + subClassOf: "http://www.w3.org/2001/XMLSchema#token", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :QName, - comment: "\n QName represents XML qualified names. The ·value space· of QName is the set\n of tuples {namespace name, local part}, where namespace name is an anyURI\n and local part is an NCName. The ·lexical space· of QName is the set of\n strings that ·match· the QName production of [Namespaces in XML].\n ".freeze, - label: "QName".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n QName represents XML qualified names. The ·value space· of QName is the set\n of tuples {namespace name, local part}, where namespace name is an anyURI\n and local part is an NCName. The ·lexical space· of QName is the set of\n strings that ·match· the QName production of [Namespaces in XML].\n ", + label: "QName", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :anyAtomicType, - comment: "\n anyAtomicType is a special ·restriction· of anySimpleType. The ·value· and\n ·lexical spaces· of anyAtomicType are the unions of the ·value· and\n ·lexical spaces· of all the ·primitive· datatypes, and anyAtomicType is\n their ·base type·.\n ".freeze, - label: "anySimpleType".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n anyAtomicType is a special ·restriction· of anySimpleType. The ·value· and\n ·lexical spaces· of anyAtomicType are the unions of the ·value· and\n ·lexical spaces· of all the ·primitive· datatypes, and anyAtomicType is\n their ·base type·.\n ", + label: "anySimpleType", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :anySimpleType, - comment: "\n The definition of anySimpleType is a special ·restriction· of anyType. The\n ·lexical space· of anySimpleType is the set of all sequences of Unicode\n characters, and its ·value space· includes all ·atomic values· and all\n finite-length lists of zero or more ·atomic values·.\n ".freeze, - label: "anySimpleType".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The definition of anySimpleType is a special ·restriction· of anyType. The\n ·lexical space· of anySimpleType is the set of all sequences of Unicode\n characters, and its ·value space· includes all ·atomic values· and all\n finite-length lists of zero or more ·atomic values·.\n ", + label: "anySimpleType", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :anyType, - comment: "\n The root of the [XML Schema 1.1] datatype heirarchy.\n ".freeze, - label: "anyType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The root of the [XML Schema 1.1] datatype heirarchy.\n ", + label: "anyType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :anyURI, - comment: "\n anyURI represents an Internationalized Resource Identifier Reference\n (IRI). An anyURI value can be absolute or relative, and may have an\n optional fragment identifier (i.e., it may be an IRI Reference). This\n type should be used when the value fulfills the role of an IRI, as\n defined in [RFC 3987] or its successor(s) in the IETF Standards Track.\n ".freeze, - label: "anyURI".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n anyURI represents an Internationalized Resource Identifier Reference\n (IRI). An anyURI value can be absolute or relative, and may have an\n optional fragment identifier (i.e., it may be an IRI Reference). This\n type should be used when the value fulfills the role of an IRI, as\n defined in [RFC 3987] or its successor(s) in the IETF Standards Track.\n ", + label: "anyURI", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :base64Binary, - comment: "\n base64Binary represents arbitrary Base64-encoded binary data. For\n base64Binary data the entire binary stream is encoded using the Base64\n Encoding defined in [RFC 3548], which is derived from the encoding\n described in [RFC 2045].\n ".freeze, - label: "base64Binary".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n base64Binary represents arbitrary Base64-encoded binary data. For\n base64Binary data the entire binary stream is encoded using the Base64\n Encoding defined in [RFC 3548], which is derived from the encoding\n described in [RFC 2045].\n ", + label: "base64Binary", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :boolean, - comment: "\n boolean represents the values of two-valued logic.\n ".freeze, - label: "boolean".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n boolean represents the values of two-valued logic.\n ", + label: "boolean", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :byte, - comment: "\n byte is ·derived· from short by setting the value of ·maxInclusive· to be\n 127 and ·minInclusive· to be -128. The ·base type· of byte is short.\n ".freeze, - label: "byte".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#short".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n byte is ·derived· from short by setting the value of ·maxInclusive· to be\n 127 and ·minInclusive· to be -128. The ·base type· of byte is short.\n ", + label: "byte", + subClassOf: "http://www.w3.org/2001/XMLSchema#short", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :date, - comment: "\n date represents top-open intervals of exactly one day in length on the\n timelines of dateTime, beginning on the beginning moment of each day, up to\n but not including the beginning moment of the next day). For non-timezoned\n values, the top-open intervals disjointly cover the non-timezoned timeline,\n one per day. For timezoned values, the intervals begin at every minute and\n therefore overlap.\n ".freeze, - label: "date".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n date represents top-open intervals of exactly one day in length on the\n timelines of dateTime, beginning on the beginning moment of each day, up to\n but not including the beginning moment of the next day). For non-timezoned\n values, the top-open intervals disjointly cover the non-timezoned timeline,\n one per day. For timezoned values, the intervals begin at every minute and\n therefore overlap.\n ", + label: "date", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :dateTime, - comment: "\n dateTime represents instants of time, optionally marked with a particular\n time zone offset. Values representing the same instant but having different\n time zone offsets are equal but not identical.\n ".freeze, - label: "dateTime".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n dateTime represents instants of time, optionally marked with a particular\n time zone offset. Values representing the same instant but having different\n time zone offsets are equal but not identical.\n ", + label: "dateTime", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :dateTimeStamp, - comment: "\n The dateTimeStamp datatype is ·derived· from dateTime by giving the value\n required to its explicitTimezone facet. The result is that all values of\n dateTimeStamp are required to have explicit time zone offsets and the\n datatype is totally ordered.\n ".freeze, - label: "dateTimeStamp".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#dateTime".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The dateTimeStamp datatype is ·derived· from dateTime by giving the value\n required to its explicitTimezone facet. The result is that all values of\n dateTimeStamp are required to have explicit time zone offsets and the\n datatype is totally ordered.\n ", + label: "dateTimeStamp", + subClassOf: "http://www.w3.org/2001/XMLSchema#dateTime", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :dayTimeDuration, - comment: "\n dayTimeDuration is a datatype ·derived· from duration by restricting its\n ·lexical representations· to instances of dayTimeDurationLexicalRep. The\n ·value space· of dayTimeDuration is therefore that of duration restricted\n to those whose ·months· property is 0. This results in a duration datatype\n which is totally ordered.\n ".freeze, - label: "dayTimeDuration".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#duration".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n dayTimeDuration is a datatype ·derived· from duration by restricting its\n ·lexical representations· to instances of dayTimeDurationLexicalRep. The\n ·value space· of dayTimeDuration is therefore that of duration restricted\n to those whose ·months· property is 0. This results in a duration datatype\n which is totally ordered.\n ", + label: "dayTimeDuration", + subClassOf: "http://www.w3.org/2001/XMLSchema#duration", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :decimal, - comment: "\n decimal represents a subset of the real numbers, which can be represented\n by decimal numerals. The ·value space· of decimal is the set of numbers\n that can be obtained by dividing an integer by a non-negative power of ten,\n i.e., expressible as i / 10n where i and n are integers and n ≥ 0.\n Precision is not reflected in this value space; the number 2.0 is not\n distinct from the number 2.00. The order relation on decimal is the order\n relation on real numbers, restricted to this subset.\n ".freeze, - label: "decimal".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n decimal represents a subset of the real numbers, which can be represented\n by decimal numerals. The ·value space· of decimal is the set of numbers\n that can be obtained by dividing an integer by a non-negative power of ten,\n i.e., expressible as i / 10n where i and n are integers and n ≥ 0.\n Precision is not reflected in this value space; the number 2.0 is not\n distinct from the number 2.00. The order relation on decimal is the order\n relation on real numbers, restricted to this subset.\n ", + label: "decimal", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :double, - comment: "\n The double datatype is patterned after the IEEE double-precision 64-bit\n floating point datatype [IEEE 754-2008]. Each floating point datatype has a\n value space that is a subset of the rational numbers. Floating point\n numbers are often used to approximate arbitrary real numbers.\n ".freeze, - label: "double".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The double datatype is patterned after the IEEE double-precision 64-bit\n floating point datatype [IEEE 754-2008]. Each floating point datatype has a\n value space that is a subset of the rational numbers. Floating point\n numbers are often used to approximate arbitrary real numbers.\n ", + label: "double", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :duration, - comment: "\n duration is a datatype that represents durations of time. The concept of\n duration being captured is drawn from those of [ISO 8601], specifically\n durations without fixed endpoints. For example, \"15 days\" (whose most\n common lexical representation in duration is \"'P15D'\") is a duration value;\n \"15 days beginning 12 July 1995\" and \"15 days ending 12 July 1995\" are not\n duration values. duration can provide addition and subtraction operations\n between duration values and between duration/dateTime value pairs, and can\n be the result of subtracting dateTime values. However, only addition to\n dateTime is required for XML Schema processing and is defined in the\n function ·dateTimePlusDuration·.\n ".freeze, - label: "duration".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n duration is a datatype that represents durations of time. The concept of\n duration being captured is drawn from those of [ISO 8601], specifically\n durations without fixed endpoints. For example, \"15 days\" (whose most\n common lexical representation in duration is \"'P15D'\") is a duration value;\n \"15 days beginning 12 July 1995\" and \"15 days ending 12 July 1995\" are not\n duration values. duration can provide addition and subtraction operations\n between duration values and between duration/dateTime value pairs, and can\n be the result of subtracting dateTime values. However, only addition to\n dateTime is required for XML Schema processing and is defined in the\n function ·dateTimePlusDuration·.\n ", + label: "duration", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :float, - comment: "\n The float datatype is patterned after the IEEE single-precision 32-bit\n floating point datatype [IEEE 754-2008]. Its value space is a subset of the\n rational numbers. Floating point numbers are often used to approximate\n arbitrary real numbers.\n ".freeze, - label: "float".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The float datatype is patterned after the IEEE single-precision 32-bit\n floating point datatype [IEEE 754-2008]. Its value space is a subset of the\n rational numbers. Floating point numbers are often used to approximate\n arbitrary real numbers.\n ", + label: "float", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :gDay, - comment: "\n gDay represents whole days within an arbitrary month—days that recur at the\n same point in each (Gregorian) month. This datatype is used to represent a\n specific day of the month. To indicate, for example, that an employee gets\n a paycheck on the 15th of each month. (Obviously, days beyond 28 cannot\n occur in all months; they are nonetheless permitted, up to 31.)\n ".freeze, - label: "gDay".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n gDay represents whole days within an arbitrary month—days that recur at the\n same point in each (Gregorian) month. This datatype is used to represent a\n specific day of the month. To indicate, for example, that an employee gets\n a paycheck on the 15th of each month. (Obviously, days beyond 28 cannot\n occur in all months; they are nonetheless permitted, up to 31.)\n ", + label: "gDay", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :gMonth, - comment: "\n gMonth represents whole (Gregorian) months within an arbitrary year—months\n that recur at the same point in each year. It might be used, for example,\n to say what month annual Thanksgiving celebrations fall in different\n countries (--11 in the United States, --10 in Canada, and possibly other\n months in other countries).\n ".freeze, - label: "gMonth".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n gMonth represents whole (Gregorian) months within an arbitrary year—months\n that recur at the same point in each year. It might be used, for example,\n to say what month annual Thanksgiving celebrations fall in different\n countries (--11 in the United States, --10 in Canada, and possibly other\n months in other countries).\n ", + label: "gMonth", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :gMonthDay, - comment: "\n gMonthDay represents whole calendar days that recur at the same point in\n each calendar year, or that occur in some arbitrary calendar year.\n (Obviously, days beyond 28 cannot occur in all Februaries; 29 is\n nonetheless permitted.)\n ".freeze, - label: "gMonthDay".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n gMonthDay represents whole calendar days that recur at the same point in\n each calendar year, or that occur in some arbitrary calendar year.\n (Obviously, days beyond 28 cannot occur in all Februaries; 29 is\n nonetheless permitted.)\n ", + label: "gMonthDay", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :gYear, - comment: "\n gYear represents Gregorian calendar years.\n ".freeze, - label: "gYear".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n gYear represents Gregorian calendar years.\n ", + label: "gYear", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :gYearMonth, - comment: "\n gYearMonth represents specific whole Gregorian months in specific Gregorian years.\n ".freeze, - label: "gYearMonth".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n gYearMonth represents specific whole Gregorian months in specific Gregorian years.\n ", + label: "gYearMonth", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :hexBinary, - comment: "\n hexBinary represents arbitrary hex-encoded binary data. \n ".freeze, - label: "hexBinary".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n hexBinary represents arbitrary hex-encoded binary data. \n ", + label: "hexBinary", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :int, - comment: "\n int is ·derived· from long by setting the value of ·maxInclusive· to be\n 2147483647 and ·minInclusive· to be -2147483648. The ·base type· of int\n is long.\n ".freeze, - label: "int".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#long".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n int is ·derived· from long by setting the value of ·maxInclusive· to be\n 2147483647 and ·minInclusive· to be -2147483648. The ·base type· of int\n is long.\n ", + label: "int", + subClassOf: "http://www.w3.org/2001/XMLSchema#long", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :integer, - comment: "\n integer is ·derived· from decimal by fixing the value of ·fractionDigits·\n to be 0 and disallowing the trailing decimal point. This results in the\n standard mathematical concept of the integer numbers. The ·value space· of\n integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of\n integer is decimal.\n ".freeze, - label: "integer".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#decimal".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n integer is ·derived· from decimal by fixing the value of ·fractionDigits·\n to be 0 and disallowing the trailing decimal point. This results in the\n standard mathematical concept of the integer numbers. The ·value space· of\n integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of\n integer is decimal.\n ", + label: "integer", + subClassOf: "http://www.w3.org/2001/XMLSchema#decimal", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :language, - comment: "\n language represents formal natural language identifiers, as defined by [BCP\n 47] (currently represented by [RFC 4646] and [RFC 4647]) or its\n successor(s). The ·value space· and ·lexical space· of language are the set\n of all strings that conform to the pattern [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*\n ".freeze, - label: "language".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#token".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n language represents formal natural language identifiers, as defined by [BCP\n 47] (currently represented by [RFC 4646] and [RFC 4647]) or its\n successor(s). The ·value space· and ·lexical space· of language are the set\n of all strings that conform to the pattern [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*\n ", + label: "language", + subClassOf: "http://www.w3.org/2001/XMLSchema#token", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :long, - comment: "\n long is ·derived· from integer by setting the value of ·maxInclusive· to\n be 9223372036854775807 and ·minInclusive· to be -9223372036854775808. The\n ·base type· of long is integer.\n ".freeze, - label: "long".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#integer".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n long is ·derived· from integer by setting the value of ·maxInclusive· to\n be 9223372036854775807 and ·minInclusive· to be -9223372036854775808. The\n ·base type· of long is integer.\n ", + label: "long", + subClassOf: "http://www.w3.org/2001/XMLSchema#integer", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :negativeInteger, - comment: "\n negativeInteger is ·derived· from nonPositiveInteger by setting the value\n of ·maxInclusive· to be -1. This results in the standard mathematical\n concept of the negative integers. The ·value space· of negativeInteger is\n the infinite set {...,-2,-1}. The ·base type· of negativeInteger is\n nonPositiveInteger.\n ".freeze, - label: "negativeInteger".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#nonPositiveInteger".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n negativeInteger is ·derived· from nonPositiveInteger by setting the value\n of ·maxInclusive· to be -1. This results in the standard mathematical\n concept of the negative integers. The ·value space· of negativeInteger is\n the infinite set {...,-2,-1}. The ·base type· of negativeInteger is\n nonPositiveInteger.\n ", + label: "negativeInteger", + subClassOf: "http://www.w3.org/2001/XMLSchema#nonPositiveInteger", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :nonNegativeInteger, - comment: "\n nonNegativeInteger is ·derived· from integer by setting the value of\n ·minInclusive· to be 0. This results in the standard mathematical concept\n of the non-negative integers. The ·value space· of nonNegativeInteger is\n the infinite set {0,1,2,...}. The ·base type· of nonNegativeInteger is\n integer.\n ".freeze, - label: "nonNegativeInteger".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#integer".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n nonNegativeInteger is ·derived· from integer by setting the value of\n ·minInclusive· to be 0. This results in the standard mathematical concept\n of the non-negative integers. The ·value space· of nonNegativeInteger is\n the infinite set {0,1,2,...}. The ·base type· of nonNegativeInteger is\n integer.\n ", + label: "nonNegativeInteger", + subClassOf: "http://www.w3.org/2001/XMLSchema#integer", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :nonPositiveInteger, - comment: "\n nonPositiveInteger is ·derived· from integer by setting the value of\n ·maxInclusive· to be 0. This results in the standard mathematical concept\n of the non-positive integers. The ·value space· of nonPositiveInteger is\n the infinite set {...,-2,-1,0}. The ·base type· of nonPositiveInteger is\n integer.\n ".freeze, - label: "nonPositiveInteger".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#integer".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n nonPositiveInteger is ·derived· from integer by setting the value of\n ·maxInclusive· to be 0. This results in the standard mathematical concept\n of the non-positive integers. The ·value space· of nonPositiveInteger is\n the infinite set {...,-2,-1,0}. The ·base type· of nonPositiveInteger is\n integer.\n ", + label: "nonPositiveInteger", + subClassOf: "http://www.w3.org/2001/XMLSchema#integer", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :normalizedString, - comment: "\n normalizedString represents white space normalized strings. The ·value\n space· of normalizedString is the set of strings that do not contain the\n carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The\n ·lexical space· of normalizedString is the set of strings that do not\n contain the carriage return (#xD), line feed (#xA) nor tab (#x9)\n characters. The ·base type· of normalizedString is string.\n ".freeze, - label: "normalizedString".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#string".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n normalizedString represents white space normalized strings. The ·value\n space· of normalizedString is the set of strings that do not contain the\n carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The\n ·lexical space· of normalizedString is the set of strings that do not\n contain the carriage return (#xD), line feed (#xA) nor tab (#x9)\n characters. The ·base type· of normalizedString is string.\n ", + label: "normalizedString", + subClassOf: "http://www.w3.org/2001/XMLSchema#string", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :positiveInteger, - comment: "\n positiveInteger is ·derived· from nonNegativeInteger by setting the value\n of ·minInclusive· to be 1. This results in the standard mathematical\n concept of the positive integer numbers. The ·value space· of\n positiveInteger is the infinite set {1,2,...}. The ·base type· of\n positiveInteger is nonNegativeInteger.\n ".freeze, - label: "positiveInteger".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n positiveInteger is ·derived· from nonNegativeInteger by setting the value\n of ·minInclusive· to be 1. This results in the standard mathematical\n concept of the positive integer numbers. The ·value space· of\n positiveInteger is the infinite set {1,2,...}. The ·base type· of\n positiveInteger is nonNegativeInteger.\n ", + label: "positiveInteger", + subClassOf: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :short, - comment: "\n short is ·derived· from int by setting the value of ·maxInclusive· to be\n 32767 and ·minInclusive· to be -32768. The ·base type· of short is int.\n ".freeze, - label: "short".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#int".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n short is ·derived· from int by setting the value of ·maxInclusive· to be\n 32767 and ·minInclusive· to be -32768. The ·base type· of short is int.\n ", + label: "short", + subClassOf: "http://www.w3.org/2001/XMLSchema#int", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :string, - comment: "\n The string datatype represents character strings in XML.\n ".freeze, - label: "string".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n The string datatype represents character strings in XML.\n ", + label: "string", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :time, - comment: "\n time represents instants of time that recur at the same point in each\n calendar day, or that occur in some arbitrary calendar day.\n ".freeze, - label: "time".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n time represents instants of time that recur at the same point in each\n calendar day, or that occur in some arbitrary calendar day.\n ", + label: "time", + subClassOf: "http://www.w3.org/2001/XMLSchema#anyAtomicType", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :token, - comment: "\n token represents tokenized strings. The ·value space· of token is the set\n of strings that do not contain the carriage return (#xD), line feed (#xA)\n nor tab (#x9) characters, that have no leading or trailing spaces (#x20)\n and that have no internal sequences of two or more spaces. The ·lexical\n space· of token is the set of strings that do not contain the carriage\n return (#xD), line feed (#xA) nor tab (#x9) characters, that have no\n leading or trailing spaces (#x20) and that have no internal sequences of\n two or more spaces. The ·base type· of token is normalizedString.\n ".freeze, - label: "token".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#normalizedString".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n token represents tokenized strings. The ·value space· of token is the set\n of strings that do not contain the carriage return (#xD), line feed (#xA)\n nor tab (#x9) characters, that have no leading or trailing spaces (#x20)\n and that have no internal sequences of two or more spaces. The ·lexical\n space· of token is the set of strings that do not contain the carriage\n return (#xD), line feed (#xA) nor tab (#x9) characters, that have no\n leading or trailing spaces (#x20) and that have no internal sequences of\n two or more spaces. The ·base type· of token is normalizedString.\n ", + label: "token", + subClassOf: "http://www.w3.org/2001/XMLSchema#normalizedString", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :unsignedByte, - comment: "\n nsignedByte is ·derived· from unsignedShort by setting the value of\n ·maxInclusive· to be 255. The ·base type· of unsignedByte is\n unsignedShort.\n ".freeze, - label: "unsignedByte".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedShort".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n nsignedByte is ·derived· from unsignedShort by setting the value of\n ·maxInclusive· to be 255. The ·base type· of unsignedByte is\n unsignedShort.\n ", + label: "unsignedByte", + subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedShort", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :unsignedInt, - comment: "\n unsignedInt is ·derived· from unsignedLong by setting the value of\n ·maxInclusive· to be 4294967295. The ·base type· of unsignedInt is\n unsignedLong.\n ".freeze, - label: "unsignedInt".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedLong".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n unsignedInt is ·derived· from unsignedLong by setting the value of\n ·maxInclusive· to be 4294967295. The ·base type· of unsignedInt is\n unsignedLong.\n ", + label: "unsignedInt", + subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedLong", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :unsignedLong, - comment: "\n unsignedLong is ·derived· from nonNegativeInteger by setting the value of\n ·maxInclusive· to be 18446744073709551615. The ·base type· of unsignedLong\n is nonNegativeInteger.\n ".freeze, - label: "unsignedLong".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n unsignedLong is ·derived· from nonNegativeInteger by setting the value of\n ·maxInclusive· to be 18446744073709551615. The ·base type· of unsignedLong\n is nonNegativeInteger.\n ", + label: "unsignedLong", + subClassOf: "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :unsignedShort, - comment: "\n unsignedShort is ·derived· from unsignedInt by setting the value of\n ·maxInclusive· to be 65535. The ·base type· of unsignedShort is\n unsignedInt.\n ".freeze, - label: "unsignedShort".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedInt".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n unsignedShort is ·derived· from unsignedInt by setting the value of\n ·maxInclusive· to be 65535. The ·base type· of unsignedShort is\n unsignedInt.\n ", + label: "unsignedShort", + subClassOf: "http://www.w3.org/2001/XMLSchema#unsignedInt", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" term :yearMonthDuration, - comment: "\n yearMonthDuration is a datatype ·derived· from duration by restricting its\n ·lexical representations· to instances of yearMonthDurationLexicalRep. The\n ·value space· of yearMonthDuration is therefore that of duration\n restricted to those whose ·seconds· property is 0. This results in a\n duration datatype which is totally ordered.\n ".freeze, - label: "yearMonthDuration".freeze, - subClassOf: "http://www.w3.org/2001/XMLSchema#duration".freeze, - type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze + comment: "\n yearMonthDuration is a datatype ·derived· from duration by restricting its\n ·lexical representations· to instances of yearMonthDurationLexicalRep. The\n ·value space· of yearMonthDuration is therefore that of duration\n restricted to those whose ·seconds· property is 0. This results in a\n duration datatype which is totally ordered.\n ", + label: "yearMonthDuration", + subClassOf: "http://www.w3.org/2001/XMLSchema#duration", + type: "http://www.w3.org/2000/01/rdf-schema#Datatype" end end diff --git a/spec/vocab_writer_spec.rb b/spec/vocab_writer_spec.rb index 64a64b9f..b8f5bd7f 100644 --- a/spec/vocab_writer_spec.rb +++ b/spec/vocab_writer_spec.rb @@ -19,8 +19,8 @@ [ /module Bar/, /class Foo/, - %r{term :Class,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "Class".freeze,\s+type: "http://www.w3.org/2000/01/rdf-schema#Class"}m.freeze, - %r{property :prop,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "prop".freeze,\s+type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"}m.freeze, + %r{term :Class,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "Class",\s+type: "http://www.w3.org/2000/01/rdf-schema#Class"}m.freeze, + %r{property :prop,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "prop",\s+type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"}m.freeze, ].each do |regexp,| it "matches #{regexp}" do expect(serialization).to match(regexp) From 2caa5f52ffb86e8fe1cc9ff5b56e29ce2539f441 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 29 Jan 2022 11:49:22 -0800 Subject: [PATCH 09/16] Update expectation for RDF:URI with a hash argument, due to updates to rspec-mock. --- lib/rdf/model/list.rb | 2 +- spec/model_uri_spec.rb | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/rdf/model/list.rb b/lib/rdf/model/list.rb index a86dd128..7607b63e 100644 --- a/lib/rdf/model/list.rb +++ b/lib/rdf/model/list.rb @@ -476,7 +476,7 @@ def <<(value) # @return [Integer] # @see http://ruby-doc.org/core-2.2.2/Array.html#method-i-3C-3D-3E def eql?(other) - to_a.eql? other.to_a # TODO: optimize this + to_a.eql? Array(other) end ## diff --git a/spec/model_uri_spec.rb b/spec/model_uri_spec.rb index 847eac7c..7ac6b9f1 100644 --- a/spec/model_uri_spec.rb +++ b/spec/model_uri_spec.rb @@ -61,14 +61,14 @@ end it "with hash arg" do - expect(described_class).to receive(:new).with(scheme: "http", + expect(described_class).to receive(:new).with({scheme: "http", user: "user", password: "password", host: "example.com", port: 8080, path: "/path", query: "query=value", - fragment: "fragment") + fragment: "fragment"}) RDF::URI.new({ scheme: "http", user: "user", @@ -77,8 +77,7 @@ port: 8080, path: "/path", query: "query=value", - fragment: "fragment" - }) + fragment: "fragment"}) end end From 9fb42b64d945f594c6af8a3cd9d503b9e7ccad2d Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 31 Jan 2022 14:58:23 -0800 Subject: [PATCH 10/16] * When reading a vocabulary, don't skip non-english literals. * When writing a vocabulary, use language-map form for language-tagged literals with any in english serialized as the first entry of the map, Fixes #432. --- lib/rdf/vocab/writer.rb | 34 +++++++++++++++++++++++++++++++--- lib/rdf/vocabulary.rb | 4 ---- spec/vocab_writer_spec.rb | 8 +++++++- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/lib/rdf/vocab/writer.rb b/lib/rdf/vocab/writer.rb index 012b48c7..f6df8e0e 100644 --- a/lib/rdf/vocab/writer.rb +++ b/lib/rdf/vocab/writer.rb @@ -50,6 +50,19 @@ class Format < RDF::Format # range: "xsd:float", # type: "owl:DatatypeProperty", # "vs:term_status": "testing" + # + # @example term definition with language-tagged strings + # @example A term definition with tagged values + # 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" class Writer < RDF::Writer include RDF::Util::Logger format RDF::Vocabulary::Format @@ -272,9 +285,17 @@ def from_node(name, attributes, term_type) attributes.keys.sort_by(&:to_s).map(&:to_sym).each do |key| value = Array(attributes[key]) component = key.inspect.start_with?(':"') ? "#{key.to_s.inspect}: " : "#{key}: " - value = value.first if value.length == 1 + value = value.first if value.length == 1 && value.none? {|v| v.is_a?(RDF::Literal) && v.language?} component << if value.is_a?(Array) - '[' + value.map {|v| serialize_value(v, key, indent: " ")}.sort.join(", ") + "]" + # Represent language-tagged literals as a hash + lang_vals, vals = value.partition {|v| v.literal? && v.language?} + hash_val = lang_vals.inject({}) {|memo, obj| memo.merge(obj.language => obj.to_s)} + vals << hash_val unless hash_val.empty? + if vals.length > 1 + '[' + vals.map {|v| serialize_value(v, key, indent: " ")}.sort.join(", ") + "]" + else + serialize_value(vals.first, key, indent: " ") + end else serialize_value(value, key, indent: " ") end @@ -284,7 +305,14 @@ def from_node(name, attributes, term_type) end def serialize_value(value, key, indent: "") - if value.is_a?(Literal) && %w(: comment definition notation note editorialNote).include?(key.to_s) + if value.is_a?(Hash) + # Favor English + keys = value.keys + keys = keys.include?(:en) ? (keys - [:en]).sort.unshift(:en) : keys.sort + '{' + keys.map do |k| + "#{k.inspect[1..-1]}: #{value[k].inspect}" + end.join(', ') + '}' + elsif value.is_a?(Literal) && %w(: comment definition notation note editorialNote).include?(key.to_s) "#{value.to_s.inspect}" elsif value.is_a?(RDF::URI) "#{value.to_s.inspect}" diff --git a/lib/rdf/vocabulary.rb b/lib/rdf/vocabulary.rb index bef307b1..f4814942 100644 --- a/lib/rdf/vocabulary.rb +++ b/lib/rdf/vocabulary.rb @@ -521,10 +521,6 @@ def from_graph(graph, url: nil, class_name: nil, extra: nil) statement.predicate.to_s.to_sym end - # Skip literals other than plain or english - # This is because the ruby representation does not preserve language - next if statement.object.literal? && (statement.object.language || :en).to_s !~ /^en-?/ - (term[key] ||= []) << statement.object end diff --git a/spec/vocab_writer_spec.rb b/spec/vocab_writer_spec.rb index b8f5bd7f..535d535c 100644 --- a/spec/vocab_writer_spec.rb +++ b/spec/vocab_writer_spec.rb @@ -10,6 +10,9 @@ @prefix rdfs: . a rdfs:Class ; rdfs:Datatype "Class" . a rdf:Property ; rdfs:Datatype "prop" . + a rdf:Property ; rdfs:label "prop"@en . + a rdf:Property ; rdfs:label "eigen"@de, "prop"@en . + a rdf:Property ; rdfs:label "prop"@en, "eigen"@de, "none" . }} let!(:graph) { RDF::Graph.new << RDF::Turtle::Reader.new(ttl) @@ -21,6 +24,9 @@ /class Foo/, %r{term :Class,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "Class",\s+type: "http://www.w3.org/2000/01/rdf-schema#Class"}m.freeze, %r{property :prop,\s+"http://www.w3.org/2000/01/rdf-schema#Datatype": "prop",\s+type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"}m.freeze, + %r{property :lang_prop,\s+label: {en: "prop"}}m.freeze, + %r{property :lang_props,\s+label: {en: "prop", de: "eigen"}}m.freeze, + %r{property :mixed_props,\s+label: \["none", {en: "prop", de: "eigen"}\]}m.freeze, ].each do |regexp,| it "matches #{regexp}" do expect(serialization).to match(regexp) @@ -57,7 +63,7 @@ %r{inScheme: "http://eulersharp.sourceforge.net/2003/03swap/countries#iso3166-1-alpha-2"}.freeze, /notation: %\(afg\)/.freeze, %r{inScheme: "http://eulersharp.sourceforge.net/2003/03swap/countries#iso3166-1-alpha-3"}.freeze, - %r{"http://xmlns.com/foaf/0.1/name": "Afghanistan"}.freeze, + %r{"http://xmlns.com/foaf/0.1/name": {en: "Afghanistan"}}.freeze, %r{isDefinedBy: "http://eulersharp.sourceforge.net/2003/03swap/countries#"}.freeze, %r{type: "http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#Country"}.freeze, ].each do |regexp,| From 0f28ea6852322458c9868bfa07451258bf8da020 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Feb 2022 13:25:51 -0800 Subject: [PATCH 11/16] Example files for #433. --- examples/issue433/Gemfile | 8 ++++++++ examples/issue433/README.md | 7 +++++++ examples/issue433/something/enumerator.rb | 4 ++++ examples/issue433/test.rb | 7 +++++++ 4 files changed, 26 insertions(+) create mode 100644 examples/issue433/Gemfile create mode 100644 examples/issue433/README.md create mode 100644 examples/issue433/something/enumerator.rb create mode 100644 examples/issue433/test.rb diff --git a/examples/issue433/Gemfile b/examples/issue433/Gemfile new file mode 100644 index 00000000..f60206f5 --- /dev/null +++ b/examples/issue433/Gemfile @@ -0,0 +1,8 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +#ruby '2.7.5' + +gem 'rdf', path: '../..' +gem 'byebug' +gem 'amazing_print' \ No newline at end of file diff --git a/examples/issue433/README.md b/examples/issue433/README.md new file mode 100644 index 00000000..11e57148 --- /dev/null +++ b/examples/issue433/README.md @@ -0,0 +1,7 @@ +# rdf-issue + +``` +bundle install + +bundle exec ruby test.rb +``` diff --git a/examples/issue433/something/enumerator.rb b/examples/issue433/something/enumerator.rb new file mode 100644 index 00000000..e33090c2 --- /dev/null +++ b/examples/issue433/something/enumerator.rb @@ -0,0 +1,4 @@ +module Something + module Enumerator + end +end diff --git a/examples/issue433/test.rb b/examples/issue433/test.rb new file mode 100644 index 00000000..5c87b063 --- /dev/null +++ b/examples/issue433/test.rb @@ -0,0 +1,7 @@ +require 'rdf' +require 'rdf/mixin/enumerable' +require 'rdf/model/list' +require './something/enumerator' +require 'enumerator' + +puts "All OK!" From 49f6b9e8f0c982b3f0b8429e32efffe351044df5 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Feb 2022 13:28:00 -0800 Subject: [PATCH 12/16] Minor documentation/example and message changes. --- CHANGES.md | 2 +- lib/rdf/vocab/writer.rb | 21 ++++++++++----------- lib/rdf/vocabulary.rb | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ea490c0f..9991bab9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -55,7 +55,7 @@ Release 2.0.0 * Enumerables vs. Enumerators - - `RDF::Queryable#query` and `RDF::Query#execute` not return an enumerable, which may be an enumerator. Most internal uses return an Array now, which aides performance for small result sets, but potentially causes problems for large result sets. Implementations may still return an Enumerator, and Enumerators may be passed as arguments. + - `RDF::Queryable#query` and `RDF::Query#execute` did not return an enumerable, which may be an enumerator. Most internal uses return an Array now, which aides performance for small result sets, but potentially causes problems for large result sets. Implementations may still return an Enumerator, and Enumerators may be passed as arguments. - `RDF::Enumerable#statements`, `#quads`, `#triples`, `#subjects`, `#predicates`, `#objects`, and `#contexts` now return an array rather than an Enumerator. * The following vocabularies are deprecated and have been moved to the rdf-vocab gem. diff --git a/lib/rdf/vocab/writer.rb b/lib/rdf/vocab/writer.rb index f6df8e0e..d0af31a5 100644 --- a/lib/rdf/vocab/writer.rb +++ b/lib/rdf/vocab/writer.rb @@ -52,17 +52,16 @@ class Format < RDF::Format # "vs:term_status": "testing" # # @example term definition with language-tagged strings - # @example A term definition with tagged values - # 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" + # 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" class Writer < RDF::Writer include RDF::Util::Logger format RDF::Vocabulary::Format diff --git a/lib/rdf/vocabulary.rb b/lib/rdf/vocabulary.rb index f4814942..6234df69 100644 --- a/lib/rdf/vocabulary.rb +++ b/lib/rdf/vocabulary.rb @@ -1325,7 +1325,7 @@ def strict?; true; end def [](name) props.fetch(name.to_sym) rescue KeyError - raise KeyError, "#{name} not found in vocabulary #{self.__name__}" + raise KeyError, "#{name.inspect} not found in vocabulary #{self.__name__}" end end end # StrictVocabulary From b10ef2ceeef6ef5f07ae43540d9c481bb60752e9 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Feb 2022 13:29:00 -0800 Subject: [PATCH 13/16] Remove deprecation on Ruby 2.4+, as the gemspec now enforces this. --- lib/rdf.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/rdf.rb b/lib/rdf.rb index 39836ee0..b16ec0c6 100644 --- a/lib/rdf.rb +++ b/lib/rdf.rb @@ -7,9 +7,6 @@ require 'rdf/version' require 'rdf/extensions' -# When loading, issue deprecation warning on forthcoming unsupported versions of Ruby -warn "[DEPRECATION] Ruby 2.4+ required in next version 3.1 of RDF.rb" if RUBY_VERSION < "2.4" - module RDF # RDF mixins autoload :Countable, 'rdf/mixin/countable' From f50d4d17ae0d72672004d8b573b58f8cff78de30 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Feb 2022 13:29:11 -0800 Subject: [PATCH 14/16] Add bin/console. --- bin/console | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bin/console diff --git a/bin/console b/bin/console new file mode 100755 index 00000000..cba1a82b --- /dev/null +++ b/bin/console @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "rdf" + +require "irb" +require 'amazing_print' +IRB.start(__FILE__) From 71c0141c71da5c40809e3fd2fb38c0ca55c6f858 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Feb 2022 13:29:57 -0800 Subject: [PATCH 15/16] Update Countable, Enumerable, and Queryable to include their Enumerator classes inline, and remove a separate enumerator.rb to address #433. --- lib/rdf/mixin/countable.rb | 6 +++++- lib/rdf/mixin/enumerable.rb | 14 ++++++++++++- lib/rdf/mixin/enumerator.rb | 40 ------------------------------------- lib/rdf/mixin/queryable.rb | 14 ++++++++++++- 4 files changed, 31 insertions(+), 43 deletions(-) delete mode 100644 lib/rdf/mixin/enumerator.rb diff --git a/lib/rdf/mixin/countable.rb b/lib/rdf/mixin/countable.rb index c7e7dd67..26c94e40 100644 --- a/lib/rdf/mixin/countable.rb +++ b/lib/rdf/mixin/countable.rb @@ -2,9 +2,13 @@ module RDF ## # @since 0.2.0 module Countable - autoload :Enumerator, 'rdf/mixin/enumerator' extend RDF::Util::Aliasing::LateBound + # Extends Enumerator with {Countable}, which is used by {Countable#enum_for} + class Enumerator < ::Enumerator + include RDF::Countable + end + ## # Returns `true` if `self` contains no RDF statements. # diff --git a/lib/rdf/mixin/enumerable.rb b/lib/rdf/mixin/enumerable.rb index 8f1bc567..a598af27 100644 --- a/lib/rdf/mixin/enumerable.rb +++ b/lib/rdf/mixin/enumerable.rb @@ -57,11 +57,23 @@ module RDF # @see RDF::Graph # @see RDF::Repository module Enumerable - autoload :Enumerator, 'rdf/mixin/enumerator' extend RDF::Util::Aliasing::LateBound include ::Enumerable include RDF::Countable # NOTE: must come after ::Enumerable + # Extends Enumerator with {Queryable} and {Enumerable}, which is used by {Enumerable#each_statement} and {Queryable#enum_for} + class Enumerator < ::Enumerator + include RDF::Queryable + include RDF::Enumerable + + ## + # @return [Array] + # @note Make sure returned arrays are also queryable + def to_a + return super.to_a.extend(RDF::Queryable, RDF::Enumerable) + end + end + ## # Returns `true` if this enumerable supports the given `feature`. # diff --git a/lib/rdf/mixin/enumerator.rb b/lib/rdf/mixin/enumerator.rb deleted file mode 100644 index fff086d5..00000000 --- a/lib/rdf/mixin/enumerator.rb +++ /dev/null @@ -1,40 +0,0 @@ -module RDF - ## - # Enumerators for different mixins. These are defined in a separate module, so that they are bound when used, allowing other mixins inheriting behavior to be included. - module Enumerable - # Extends Enumerator with {Queryable} and {Enumerable}, which is used by {Enumerable#each_statement} and {Queryable#enum_for} - class Enumerator < ::Enumerator - include Queryable - include Enumerable - - ## - # @return [Array] - # @note Make sure returned arrays are also queryable - def to_a - return super.to_a.extend(RDF::Queryable, RDF::Enumerable) - end - end - end - - module Countable - # Extends Enumerator with {Countable}, which is used by {Countable#enum_for} - class Enumerator < ::Enumerator - include Countable - end - end - - module Queryable - # Extends Enumerator with {Queryable} and {Enumerable}, which is used by {Enumerable#each_statement} and {Queryable#enum_for} - class Enumerator < ::Enumerator - include Queryable - include Enumerable - - ## - # @return [Array] - # @note Make sure returned arrays are also queryable - def to_a - return super.to_a.extend(RDF::Queryable, RDF::Enumerable) - end - end - end -end diff --git a/lib/rdf/mixin/queryable.rb b/lib/rdf/mixin/queryable.rb index 07aee6cc..42438823 100644 --- a/lib/rdf/mixin/queryable.rb +++ b/lib/rdf/mixin/queryable.rb @@ -9,9 +9,21 @@ module RDF # @see RDF::Graph # @see RDF::Repository module Queryable - autoload :Enumerator, 'rdf/mixin/enumerator' include ::Enumerable + # Extends Enumerator with {Queryable} and {Enumerable}, which is used by {Enumerable#each_statement} and {Queryable#enum_for} + class Enumerator < ::Enumerator + include RDF::Queryable + include RDF::Enumerable + + ## + # @return [Array] + # @note Make sure returned arrays are also queryable + def to_a + return super.to_a.extend(RDF::Queryable, RDF::Enumerable) + end + end + ## # Queries `self` for RDF statements matching the given `pattern`. # From c0805e0e636c91feb3abf6b80d1bae5f6f516f8e Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 8 Feb 2022 11:16:10 -0800 Subject: [PATCH 16/16] Version 3.2.4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b347b11e..351227fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.3 +3.2.4