.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "2020-12-22" "perl v5.32.0" "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 \s-1JSONLD\s0 version 0.005. .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 \s-1JSON\s0 data as linked data. .PP This version provides full support for the JSON-LD 1.1 \*(L"Expansion\*(R" and \&\*(L"toRdf\*(R" transformations (the latter primarily being useful through a subclass of JSON-LD, such as that provided by AtteanX::Parser::JSONLD). Partial support for the \*(L"Compaction\*(R" transformation is provided, but it contains many known deficiencies. Full support for \*(L"Compaction\*(R" 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 \&\s-1NOTE:\s0 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 \s-1RDF.\s0 .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 \s-1RDF.\s0 .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(CW\*(C`default_graph()\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`new_dataset()\*(C'\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(CW\*(C`new_iri($value)\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`new_graphname($value)\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`new_blank( [$id] )\*(C'\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 \s-1API\s0 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.