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
# Otherwise, return the result of compacting flattened according the Compaction algorithm passing context ensuring that the compaction result uses the @graph keyword (or its alias) at the top-level, even if the context is empty or if there is only one element to put in the @graph array. This ensures that the returned document has a deterministic structure.
# Uses built-in or provided documentLoader to retrieve a parsed document.
533
547
#
534
548
# @param [RDF::URI, String] url
549
+
# @param [String, RDF::URI] base
550
+
# Location to use as documentUrl instead of `url`.
551
+
# @option options [Proc] :documentLoader
552
+
# The callback of the loader to be used to retrieve remote documents and contexts.
535
553
# @param [Boolean] extractAllScripts
536
554
# If set to `true`, when extracting JSON-LD script elements from HTML, unless a specific fragment identifier is targeted, extracts all encountered JSON-LD script elements using an array form, if necessary.
537
555
# @param [String] profile
538
556
# When the resulting `contentType` is `text/html` or `application/xhtml+xml`, this option determines the profile to use for selecting a JSON-LD script elements.
539
557
# @param [String] requestProfile
540
558
# One or more IRIs to use in the request as a profile parameter.
541
-
# @param [Boolean] validate
559
+
# @param [Boolean] validate (false)
542
560
# Allow only appropriate content types
543
-
# @param [String, RDF::URI] base
544
-
# Location to use as documentUrl instead of `url`.
# If a block is given, the result of evaluating the block is returned, otherwise, the retrieved remote document and context information unless block given
Copy file name to clipboardExpand all lines: lib/json/ld/compact.rb
+39-20Lines changed: 39 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,16 @@ module Compact
12
12
# This algorithm compacts a JSON-LD document, such that the given context is applied. This must result in shortening any applicable IRIs to terms or compact IRIs, any applicable keywords to keyword aliases, and any applicable JSON-LD values expressed in expanded form to simple values such as strings or numbers.
13
13
#
14
14
# @param [Array, Hash] element
15
-
# @param [String] property (nil)
16
-
# @param [Boolean] ordered (true)
15
+
# @param [String, RDF::URI] base (nil)
17
16
# Ensure output objects have keys ordered properly
0 commit comments