.\" Automatically generated by Pod::Man 4.14 (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 .. .\" 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 "PERLRDF 1p" .TH PERLRDF 1p "2023-02-08" "perl v5.36.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" perlrdf \- perlrdf command line utils .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& $ perlrdf make_store \-\-sqlite=mystore.dat \& Initialized RDF::Trine::Store::DBI::SQLite \& \& $ perlrdf validate input.rdf \& 1..1 \& ok 1 \- file:///tmp/example/input.rdf is valid RDFXML, 9 triples \& \& $ perlrdf store_load \-\-autograph \-\-sqlite=mystore.dat input.rdf \& Loading file:///tmp/example/input.rdf \& \& $ perlrdf store_dump \-\-sqlite=mystore.dat output.nq \& Writing file:///tmp/example/output.nq \& \& $ perlrdf translate output.nq output.rdf \& \& $ perlrdf isomorphic input.rdf output.rdf \& graphs are isomorphic .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" perlrdf is a single front-end to various \s-1RDF\s0 functionality available for Perl. The core distribution includes commands for create and manipulate quad stores (i.e. databases for \s-1RDF\s0 data); and commands to parse, serialise, convert and validate \s-1RDF\s0 data in various formats. .PP However, perlrdf is pluggable and it is anticipated that plugins on \s-1CPAN\s0 will cover other tasks such as \s-1RDF\s0 querying, signing, encryption, and reasoning. .SH "COMMANDS" .IX Header "COMMANDS" This section describes the commands included with the core App::perlrdf distribution. Others are available as plugins. Run \f(CW\*(C`perlrdf commands\*(C'\fR to see a list of locally installed commands. .SS "Meta Commands" .IX Subsection "Meta Commands" \fI\f(CI\*(C`perlrdf about\*(C'\fI\fR .IX Subsection "perlrdf about" .PP Shows the version numbers of all installed perlrdf commands, plus the \s-1CPAN ID\s0 of each command's author. .PP \fI\f(CI\*(C`perlrdf aliases\*(C'\fI\fR .IX Subsection "perlrdf aliases" .PP Many commands have aliases or shortcuts. For example, the following two are equivalent: .PP .Vb 2 \& $ perlrdf translate input.ttl output.rdf \& $ perlrdf tr input.ttl output.rdf .Ve .PP \&\f(CW\*(C`perlrdf aliases\*(C'\fR shows a list of available aliases. .PP \fI\f(CI\*(C`perlrdf commands\*(C'\fI\fR .IX Subsection "perlrdf commands" .PP Shows a list of installed perlrdf commands, along with a brief extract. .PP \fI\f(CI\*(C`perlrdf filespec\*(C'\fI\fR .IX Subsection "perlrdf filespec" .PP Shows help on \*(L"File Specifications\*(R". FileSpecs are an App::perlrdf\-specific microsyntax for specifying a filename or \s-1URI\s0 along with a tiny bit of associated key-value metadata. The following are three examples of FileSpecs: .PP .Vb 3 \& {format:RDFXML}C:\eData\econtacts.xml \& http://www.example.com/mydata.ttl \& {format:Turtle,base:"http://example.net/"}stdin: .Ve .PP Running the \f(CW\*(C`perlrdf filespec\*(C'\fR command on its own shows some help on using FileSpecs. If you run it with additional arguments, these are parsed as FileSpecs with debugging information shown. .PP .Vb 6 \& $ perlrdf filespec /tmp/foo.rdf \& { \& "base" : "file:///tmp/foo.rdf", \& "format" : "RDF::Trine::Parser::RDFXML", \& "uri" : "file:///tmp/foo.rdf" \& } .Ve .PP \fI\f(CI\*(C`perlrdf help\*(C'\fI\fR .IX Subsection "perlrdf help" .PP Running the \f(CW\*(C`perlrdf help\*(C'\fR command on its own shows a list of commands with their abstracts. Detailed help for a particular command can be shown by providing that as an argument. For example, for help on the \&\f(CW\*(C`perlrdf translate\*(C'\fR command, run: .PP .Vb 1 \& $ perlrdf help translate .Ve .SS "Parsing and Serialization" .IX Subsection "Parsing and Serialization" In general, parsing and serialization commands take one or more FileSpecs as arguments. These can be provided as options, as in: .PP .Vb 1 \& $ perlrdf translate \-\-input\-spec="in.nt" \-\-output\-spec="out.rdf" .Ve .PP Alternatively the first \*(L"positional argument\*(R" will usually be treated as an input FileSpec, and the second as an output FileSpec: .PP .Vb 1 \& $ perlrdf translate in.nt out.rdf .Ve .PP Using options rather than positional parameters can often be clearer, and is the recommended way of passing parameters, especially when you need to pass multiple input files or multiple output files as parameters. .PP When no inputs are provided as named or positional arguments, \s-1STDIN\s0 is normally used. When no outputs are provided, output normally goes to \s-1STDOUT.\s0 .PP \fI\f(CI\*(C`perlrdf canonicalize\*(C'\fI\fR .IX Subsection "perlrdf canonicalize" .PP Given a single FileSpec as input, serializes as canonical N\-Triples, which is a useful format for \s-1SHA1/MD5\s0 digests, graph signing, etc, because it means that incidental features of serialization (blank node identifiers, whitespace, order of statements) don't affect the output. If no input FileSpec is provided, then defaults to \s-1STDIN.\s0 .PP A filename or \s-1URL\s0 (but not a full FileSpec) may be provided for output. Otherwise defaults to \s-1STDOUT.\s0 .PP \fI\f(CI\*(C`perlrdf translate\*(C'\fI\fR .IX Subsection "perlrdf translate" .PP Parses one or more input FileSpecs into a single \s-1RDF\s0 graph and serializes them to one or more output FileSpecs. Thus this command can be used as a translator between different \s-1RDF\s0 serializations, and also as a graph concatenator. .PP .Vb 6 \& $ perlrdf translate \e \& \-\-skolem \e \& \-i "{format:RDFXML}/tmp/contacts.xml" \e \& \-i "http://www.example.com/employees.ttl" \e \& \-o "merged\-contacts.nt" \e \& \-o "merged\-contacts.rdf" .Ve .PP The 'skolem' option allows you to generate URIs for any blank nodes in the graph. (Not especially fantastic URIs, but URIs all the same.) .PP \fI\f(CI\*(C`perlrdf validate\*(C'\fI\fR .IX Subsection "perlrdf validate" .PP Parses one or more input FileSpecs (doing nothing with the results), and makes sure that each file parses without croaking. Writes output to \s-1STDOUT\s0 in \s-1TAP\s0 format. .PP .Vb 1 \& $ perlrdf validate "foo.ttl" "ftp://acme.example.com/pub/bar.rdf" .Ve .PP It's often a good idea to validate \s-1RDF\s0 before attempting to load it into a store. .SS "Quad Store Management" .IX Subsection "Quad Store Management" RDF::Trine stores can be connected to using DSN-like configuration strings such as: .PP .Vb 1 \& DBI;mymodel;DBI:mysql:database=rdf;user;password .Ve .PP These configuration strings are passed to the App::perlrdf tool using the \&'store' option: .PP .Vb 2 \& $ perlrdf make_store \e \& \-\-store="DBI;mymodel;DBI:mysql:database=rdf;user;password" .Ve .PP For the common case of DBI-backed stores, App::perlrdf offers the ability to avoid configuration strings and just specify database type, name, etc: .PP .Vb 6 \& $ perlrdf make_store \e \& \-\-database=mysql \e \& \-\-dbname=rdf \e \& \-\-username=user \e \& \-\-password=password \e \& \-\-model=contacts_db .Ve .PP SQLite-backed stores are particularly easy to work with: .PP .Vb 1 \& $ perlrdf make_store \-\-sqlite=/tmp/mydatabase.sqlite .Ve .PP If no store is specified on the command line, the \f(CW\*(C`PERLRDF_STORE\*(C'\fR environment variable is consulted. .PP .Vb 2 \& $ setenv PERLRDF_STORE "DBI;xyz;DBI:mysql:database=rdf;un;pw" \& $ perlrdf make_store .Ve .PP \fI\f(CI\*(C`perlrdf make_store\*(C'\fI\fR .IX Subsection "perlrdf make_store" .PP Initializes the store, creating empty data structures, etc. .PP If the store already exists this \fIshould\fR be non-destructive. .PP \fI\f(CI\*(C`perlrdf store_describe\*(C'\fI\fR .IX Subsection "perlrdf store_describe" .PP Describes a resource in the database. .PP .Vb 3 \& $ perlrdf store_describe \-\-sqlite=/tmp/mydatabase.sqlite \e \& \-\-output\-format=RDFXML \e \& "http://www.example.com/id/alice" .Ve .PP \fI\f(CI\*(C`perlrdf store_dump\*(C'\fI\fR .IX Subsection "perlrdf store_dump" .PP Dumps the contents of a store to a FileSpec, or to \s-1STDOUT.\s0 As with the \&\f(CW\*(C`translate\*(C'\fR command, this may take multiple output filenames. .PP With the 'graph' option, you can limit the dump to specific graphs. .PP \fI\f(CI\*(C`perlrdf store_load\*(C'\fI\fR .IX Subsection "perlrdf store_load" .PP Loads one or more FileSpecs into the store. By default, data is loaded as triples (in no graph). You can specify a graph \s-1URI\s0 for the data using the \&'graph' option; or use the 'autograph' option to indicate that you wish to use the FileSpec URIs as graph URIs. .PP \fI\f(CI\*(C`perlrdf store_truncate\*(C'\fI\fR .IX Subsection "perlrdf store_truncate" .PP Deletes all data from a store. .PP With the 'graph' option, you can delete specific graphs. .SS "Other" .IX Subsection "Other" \fI\f(CI\*(C`perlrdf isomorphic\*(C'\fI\fR .IX Subsection "perlrdf isomorphic" .PP Given two input FileSpecs, checks whether they are isomorphic (i.e. the same graph after mapping blank node identifiers). If they are non-isomorphic, it will also inform you about them differing in \*(L"interesting\*(R" ways \- i.e. one graph being an exact subgraph of the other. .PP \fI\f(CI\*(C`perlrdf prefix\*(C'\fI\fR .IX Subsection "perlrdf prefix" .PP Looks up one or more prefixes using \s-1RDF::NS.\s0 .PP .Vb 5 \& $ perlrdf prefix rdf,rdfs,owl,xsd \& owl http://www.w3.org/2002/07/owl# \& rdf http://www.w3.org/1999/02/22\-rdf\-syntax\-ns# \& rdfs http://www.w3.org/2000/01/rdf\-schema# \& xsd http://www.w3.org/2001/XMLSchema# \& \& $ perlrdf prefix \-\-format=turtle foaf,dc \& @prefix dc: . \& @prefix foaf: . .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::Trine, RDF::TriN3, RDF::Query, RDF::Query::Client, \&\s-1RDF::NS\s0. .PP Find App::perlrdf plugins on MetaCPAN: . .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2012 by Toby Inkster. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0