Skip to content

Commit 4ce38e0

Browse files
committed
Finish 1.1.3
2 parents 6f1a406 + 1a8c93b commit 4ce38e0

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
group :debug do
1414
gem "wirble"
15-
gem "debugger", :platforms => [:mri_19, :mri_20]
15+
gem "byebug", :platforms => :mri_20
1616
end
1717

1818
platforms :rbx do

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.2
1+
1.1.3

example-files/cog_.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"http://rdfs.org/sioc/ns#content": {
3+
"@value": "foo",
4+
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
5+
}
6+
}

lib/json/ld/to_rdf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def parse_object(item)
8484
# Otherwise, if datatype is null, set it to xsd:string or xsd:langString, depending on if item has a @language key.
8585
datatype ||= item.has_key?('@language') ? RDF.langString : RDF::XSD.string
8686
end
87+
datatype = RDF::URI(datatype) if datatype && !datatype.is_a?(RDF::URI)
8788

8889
# Initialize literal as an RDF literal using value and datatype. If element has the key @language and datatype is xsd:string, then add the value associated with the @language key as the language of the object.
8990
language = item.fetch('@language', nil)

script/parse

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ begin
55
require 'linkeddata'
66
rescue LoadError
77
end
8-
require 'ruby-prof'
98
require 'json/ld'
109
require 'getoptlong'
1110
require 'open-uri'

spec/to_rdf_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,17 @@
637637
<http://example.com/#you> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
638638
)
639639
],
640+
"XMLLiteral" => [
641+
%q({
642+
"http://rdfs.org/sioc/ns#content": {
643+
"@value": "foo",
644+
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
645+
}
646+
}),
647+
%q(
648+
[<http://rdfs.org/sioc/ns#content> "foo"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>] .
649+
)
650+
]
640651
}.each do |title, (js, ttl)|
641652
it title do
642653
ttl = "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . #{ttl}"

0 commit comments

Comments
 (0)