.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "JSONLD 3pm" .TH JSONLD 3pm 2024-01-21 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME JSONLD \- A toolkit for transforming JSON\-LD data. .SH VERSION .IX Header "VERSION" This document describes JSONLD version 0.006. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use v5.14; \& use JSON; \& use JSONLD; \& \& my $infile = \*(Aqtest.jsonld\*(Aq; \& open(my $fh, \*(Aq<\*(Aq, $infile) or die $!; \& my $content = do { local($/); <$fh> }; \& my $data = JSON\->new()\->boolean_values(0, 1)\->decode($content); \& \& my $jld = JSONLD\->new(); \& my $expanded = $jld\->expand($data); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module implements part of the JSON-LD 1.1 standard for manipulating JSON data as linked data. .PP This version provides full support for the JSON-LD 1.1 "Expansion" and "toRdf" transformations (the latter primarily being useful through a subclass of JSON-LD, such as that provided by AtteanX::Parser::JSONLD). Partial support for the "Compaction" transformation is provided, but it contains many known deficiencies. Full support for "Compaction" may be forthcoming in a future release. No other JSON-LD transformation are supported at this time. .SH METHODS .IX Header "METHODS" .ie n .IP """compact( $data, [$context] )""" 4 .el .IP "\f(CWcompact( $data, [$context] )\fR" 4 .IX Item "compact( $data, [$context] )" Returns the JSON-LD compaction of \f(CW$data\fR, using the optionally supplied \&\f(CW$context\fR. .Sp NOTE: Support for JSON-LD Compaction is not fully supported in this version. .ie n .IP """expand( $data, [expandContext => $ctx] )""" 4 .el .IP "\f(CWexpand( $data, [expandContext => $ctx] )\fR" 4 .IX Item "expand( $data, [expandContext => $ctx] )" Returns the JSON-LD expansion of \f(CW$data\fR. .Sp If an \f(CW\*(C`expandContext\*(C'\fR value is supplied, it is used to construct the initial active context for the expansion process. .ie n .IP """to_rdf( $data, [expandContext => $ctx] )""" 4 .el .IP "\f(CWto_rdf( $data, [expandContext => $ctx] )\fR" 4 .IX Item "to_rdf( $data, [expandContext => $ctx] )" Returns the dataset generated by turning the JSON-LD expansion of \f(CW$data\fR into RDF. .Sp If an \f(CW\*(C`expandContext\*(C'\fR value is supplied, it is passed to the \f(CW\*(C`expand\*(C'\fR function call that takes place internally prior to generating RDF. .Sp Note: this method must be called on a \f(CW\*(C`JSONLD\*(C'\fR subclass which implements the RDF-related methods: .RS 4 .IP \(bu 4 \&\f(CWdefault_graph()\fR .IP \(bu 4 \&\f(CWnew_dataset()\fR .IP \(bu 4 \&\f(CW\*(C`new_triple($s, $p, $o)\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`new_quad($s, $p, $o, $g)\*(C'\fR .IP \(bu 4 \&\f(CWnew_iri($value)\fR .IP \(bu 4 \&\f(CWnew_graphname($value)\fR .IP \(bu 4 \&\f(CWnew_blank( [$id] )\fR .IP \(bu 4 \&\f(CW\*(C`new_lang_literal($value, $lang)\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`new_dt_literal($value, $datatype)\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`add_quad($quad, $dataset)\*(C'\fR .RE .RS 4 .Sp See AtteanX::Parser::JSONLD for an API that provides this functionality. .RE .SH BUGS .IX Header "BUGS" Please report any bugs or feature requests to through the GitHub web interface at . .SH "SEE ALSO" .IX Header "SEE ALSO" .IP 4 .IX Item "" .PD 0 .IP AtteanX::Parser::JSONLD 4 .IX Item "AtteanX::Parser::JSONLD" .IP 4 .IX Item "" .IP 4 .IX Item "" .IP MooX::Role::JSON_LD 4 .IX Item "MooX::Role::JSON_LD" .PD .SH AUTHOR .IX Header "AUTHOR" Gregory Todd Williams \f(CW\*(C`\*(C'\fR .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2019\-\-2020 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.