You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If property is @type, construct triple as an RDF Triple composed of id, rdf:type, and object from values where id and object are represented either as IRIs or Blank Nodes
# If item is a list object, initialize list_results as an empty array, and object to the result of the List Conversion algorithm, passing the value associated with the @list key from item and list_results.
# Append a triple composed of subject, prediate, and literal to results.
55
-
yieldRDF::Statement(subject,predicate,object)
56
-
end
57
-
end
58
-
end
59
-
end
60
-
end
61
-
end
62
-
63
-
##
64
-
# Parse an item, either a value object or a node definition
65
-
# @param [Hash] item
66
-
# @return [RDF::Value]
67
-
defparse_object(item)
68
-
ifitem.has_key?('@value')
69
-
# Otherwise, if element is a JSON object that contains the key @value
70
-
# Initialize value to the value associated with the @value key in element. Initialize datatype to the value associated with the @type key in element, or null if element does not contain that key.
# If value is true or false, then set value its canonical lexical form as defined in the section Data Round Tripping. If datatype is null, set it to xsd:boolean.
76
22
value=value.to_s
77
23
datatype ||= RDF::XSD.boolean.to_s
78
-
whenFloat,Fixnum
24
+
whenInteger,Float,Fixnum
79
25
# Otherwise, if value is a number, then set value to its canonical lexical form as defined in the section Data Round Tripping. If datatype is null, set it to either xsd:integer or xsd:double, depending on if the value contains a fractional and/or an exponential component.
80
26
lit=RDF::Literal.new(value,canonicalize: true)
81
27
value=lit.to_s
@@ -88,13 +34,77 @@ def parse_object(item)
88
34
89
35
# 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.
# If property is @type, construct triple as an RDF Triple composed of id, rdf:type, and object from values where id and object are represented either as IRIs or Blank Nodes
# If item is a list object, initialize list_results as an empty array, and object to the result of the List Conversion algorithm, passing the value associated with the @list key from item and list_results.
# If item is a list object, initialize list_results as an empty array, and object to the result of the List Conversion algorithm, passing the value associated with the @list key from item and list_results.
0 commit comments