Skip to content
Browse files

usesVocabulary chaned to hasVocabulary.

  • Loading branch information...
1 parent de5bb66 commit 878848cb8912a8d0940402faef48f39718ab2fed @gkellogg gkellogg committed Feb 27, 2012
Showing with 30 additions and 30 deletions.
  1. +6 −6 README.markdown
  2. +1 −1 example.rb
  3. +2 −2 lib/rdf/rdfa/expansion.rb
  4. +2 −2 lib/rdf/rdfa/reader.rb
  5. +15 −15 spec/expansion_spec.rb
  6. +4 −4 spec/reader_spec.rb
View
12 README.markdown
@@ -36,7 +36,7 @@ specifically rules prp-eqp1, prp-eqp2, cax-sco, cax-eqc1, and
cax-eqc2. This causes sub-classes and sub-properties of type and property IRIs to be added
to the output graph.
-{RDF::RDFa::Reader} implements this using the `#expand` method, which looks for `rdfa:hasVocabulary` properties within the output graph and performs such expansion. See an example in the usage section.
+{RDF::RDFa::Reader} implements this using the `#expand` method, which looks for `rdfa:usesVocabulary` properties within the output graph and performs such expansion. See an example in the usage section.
#### RDF Collections (lists)
One significant RDF feature missing from RDFa was support for ordered collections, or lists. RDF supports this with special properties `rdf:first`, `rdf:rest`, and `rdf:nil`, but other RDF languages have first-class support for this concept. For example, in [Turtle][Turtle], a list can be defined as follows:
@@ -359,7 +359,7 @@ Full documentation available on [Rubydoc.info][RDFa doc]
* [History]{file:History.markdown}
* [RDFa 1.1 Core][RDFa 1.1 Core]
* [XHTML+RDFa 1.1][XHTML+RDFa 1.1]
-* [RDFa-test-suite](http://rdfa.digitalbazaar.com/test-suite/ "RDFa test suite")
+* [RDFa-test-suite](http://rdfa.info/test-suite/ "RDFa test suite")
## Author
* [Gregg Kellogg](http://github.com/gkellogg) - <http://kellogg-assoc.com/>
@@ -397,11 +397,11 @@ see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
[YARD]: http://yardoc.org/
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
-[RDFa 1.1 Core]: http://www.w3.org/TR/2011/WD-rdfa-core-20110331/ "RDFa 1.1 Core"
+[RDFa 1.1 Core]: http://www.w3.org/TR/2011/WD-rdfa-core-20110331/ "RDFa 1.1 Core"
[RDFa Lite 1.1]: http://www.w3.org/2010/02/rdfa/drafts/2011/ED-rdfa-lite-20111030/ "RDFa Lite 1.1"
-[XHTML+RDFa 1.1]: http://www.w3.org/TR/2011/WD-xhtml-rdfa-20110331/ "XHTML+RDFa 1.1"
-[HTML+RDFa 1.1]: http://www.w3.org/TR/2011/WD-rdfa-in-html-20110525/ "HTML+RDFa 1.1"
-[RDFa-test-suite]: http://rdfa.digitalbazaar.com/test-suite/ "RDFa test suite"
+[XHTML+RDFa 1.1]: http://www.w3.org/TR/2011/WD-xhtml-rdfa-20110331/ "XHTML+RDFa 1.1"
+[HTML+RDFa 1.1]: http://www.w3.org/TR/2011/WD-rdfa-in-html-20110525/ "HTML+RDFa 1.1"
+[RDFa-test-suite]: http://rdfa.info/test-suite/ "RDFa test suite"
[RDFa doc]: http://rubydoc.info/github/gkellogg/rdf-rdfa/frames
[Haml]: http://haml-lang.com/
[Turtle]: http://www.w3.org/TR/2011/WD-turtle-20110809/
View
2 example.rb
@@ -17,7 +17,7 @@
</html>
EOF
-reader = RDF::RDFa::Reader.new(data, :base_uri => 'http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml1/0001.xhtml')
+reader = RDF::RDFa::Reader.new(data, :base_uri => 'http://rdfa.info/test-suite/test-cases/xhtml1/0001.xhtml')
reader.each_statement do |statement|
statement.inspect!
end
View
4 lib/rdf/rdfa/expansion.rb
@@ -14,7 +14,7 @@ module Expansion
# triples to the default graph based on rules and property/class relationships
# described in referenced vocabularies.
#
- # For all objects that are the target of an rdfa:hasVocabulary property, load the IRI into
+ # For all objects that are the target of an rdfa:usesVocabulary property, load the IRI into
# a repository.
#
# Subsequently, perform OWL expansion using rules prp-spo1, prp-eqp1,
@@ -48,7 +48,7 @@ def expand
@@vocab_repo = @options[:vocab_repository] if @options.has_key?(:vocab_repository)
@@vocab_repo ||= RDF::Repository.new.insert(*COOKED_VOCAB_STATEMENTS)
- vocabs = repo.query(:predicate => RDF::RDFA.hasVocabulary).to_a.map(&:object)
+ vocabs = repo.query(:predicate => RDF::RDFA.usesVocabulary).to_a.map(&:object)
vocabs.each do |vocab|
begin
unless @@vocab_repo.has_context?(vocab)
View
4 lib/rdf/rdfa/reader.rb
@@ -284,7 +284,7 @@ def initialize(input = $stdin, options = {}, &block)
detect_host_language_version(input, options)
- add_info(@doc, "version = #{@version}, host_language = #{@host_language}, library = #{@library}")
+ add_info(@doc, "version = #{@version}, host_language = #{@host_language}, library = #{@library}, rdfagraph = #{@options[:rdfagraph].inspect}, expand = #{@options[:vocab_expansion]}")
begin
initialize_xml(input, options)
@@ -648,7 +648,7 @@ def traverse(element, evaluation_context)
@host_defaults.fetch(:vocabulary, nil)
else
# Generate a triple indicating that the vocabulary is used
- add_triple(element, base, RDF::RDFA.hasVocabulary, uri(attrs[:vocab]))
+ add_triple(element, base, RDF::RDFA.usesVocabulary, uri(attrs[:vocab]))
uri(attrs[:vocab])
end
View
30 spec/expansion_spec.rb
@@ -158,87 +158,87 @@ def parse(ttl)
describe :expand do
{
"simple" => {
- :default => %q(<document> rdfa:hasVocabulary ex: .),
- :result => %q(<document> rdfa:hasVocabulary ex: .)
+ :default => %q(<document> rdfa:usesVocabulary ex: .),
+ :result => %q(<document> rdfa:usesVocabulary ex: .)
},
"prp-spo1" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> ex:name "Gregg Kellogg" .
),
"http://example.org/vocab#" => %q(
ex:name rdfs:subPropertyOf foaf:name .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> ex:name "Gregg Kellogg";
foaf:name "Gregg Kellogg" .
)
},
"prp-eqp1" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> ex:name "Gregg Kellogg" .
),
"http://example.org/vocab#" => %q(
ex:name owl:equivalentProperty foaf:name .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> ex:name "Gregg Kellogg";
foaf:name "Gregg Kellogg" .
)
},
"prp-eqp2" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> foaf:name "Gregg Kellogg" .
),
"http://example.org/vocab#" => %q(
ex:name owl:equivalentProperty foaf:name .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> ex:name "Gregg Kellogg";
foaf:name "Gregg Kellogg" .
)
},
"cax-sco" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a ex:Person .
),
"http://example.org/vocab#" => %q(
ex:Person rdfs:subClassOf foaf:Person .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a ex:Person, foaf:Person .
)
},
"cax-eqc1" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a ex:Person .
),
"http://example.org/vocab#" => %q(
ex:Person owl:equivalentClass foaf:Person .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a ex:Person, foaf:Person .
)
},
"cax-eqc2" => {
:default => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a foaf:Person .
),
"http://example.org/vocab#" => %q(
ex:Person owl:equivalentClass foaf:Person .
),
:result => %q(
- <document> rdfa:hasVocabulary ex: .
+ <document> rdfa:usesVocabulary ex: .
<#me> a ex:Person, foaf:Person .
)
},
@@ -317,7 +317,7 @@ def parse(ttl)
@prefix dc: <http://purl.org/dc/terms/> .
<> a doap:Project, wn:Project, foaf:Project;
- rdfa:hasVocabulary <http://usefulinc.com/ns/doap#>;
+ rdfa:usesVocabulary <http://usefulinc.com/ns/doap#>;
doap:name "RDF::RDFa";
rdfs:label "RDF::RDFa";
dc:creator <http://greggkellogg.net/foaf#me> .
View
8 spec/reader_spec.rb
@@ -472,7 +472,7 @@
query = %q(
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfa: <http://www.w3.org/ns/rdfa#>
- ASK WHERE { <http://example.org/> rdfa:hasVocabulary foaf: }
+ ASK WHERE { <http://example.org/> rdfa:usesVocabulary foaf: }
)
parse(@sampledoc).should pass_query(query, @debug)
end
@@ -1033,7 +1033,7 @@
</div>
</div></root>),
%q(
- <> <http://www.w3.org/ns/rdfa#hasVocabulary> <#>, <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ <> <http://www.w3.org/ns/rdfa#usesVocabulary> <#>, <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:a <#flavor> ("Lemon sorbet" "Apricot sorbet") .
)
],
@@ -1052,7 +1052,7 @@
),
%q(
@prefix schema: <http://schema.org/> .
- <> <http://www.w3.org/ns/rdfa#hasVocabulary> <http://schema.org/> .
+ <> <http://www.w3.org/ns/rdfa#usesVocabulary> <http://schema.org/> .
[ a schema:Event;
schema:url <nba-miami-philidelphia-game3.html>;
schema:description """
@@ -1074,7 +1074,7 @@
),
%q(
@prefix schema: <http://schema.org/> .
- <> <http://www.w3.org/ns/rdfa#hasVocabulary> <http://schema.org/> .
+ <> <http://www.w3.org/ns/rdfa#usesVocabulary> <http://schema.org/> .
[ a schema:Event;
schema:offers [
a schema:AggregateOffer;

0 comments on commit 878848c

Please sign in to comment.
Something went wrong with that request. Please try again.