Download the PHP package alcamo/rdfa without Composer

On this page you can find all versions of the php package alcamo/rdfa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rdfa

Usage example

use alcamo\rdfa\RdfaData;

$rdfaData = RdfaData::newFromIterable(
    [
        [ 'dc:title', 'Example data' ],
        [ 'dc:creator', 'Alice' ],
        [ 'dc:creator', 'Bob' ],
        [ 'dc:created', '2025-10-21T19:09+02:00' ]
    ]
);

/* $rdfaData['dc:title'] is an array because a subject may have
 * multiple titles. */

$titles = $rdfaData['dc:title'];

echo 'Title: ' . reset($titles) . "\n";

/* $rdfaData['dc:creator'] is an array for the same reason. */

echo 'Creators: ';

foreach ($rdfaData['dc:creator'] as $creator) {
    echo "$creator, ";
}

echo "\n";

/* $rdfaData['dc:created'] is a single DcCreated object because a
 * subject may have only one such property. */

echo "Created at: {$rdfaData['dc:created']}\n";

/* The format() method is applied to the DateTime object contained in
 * the DcCreated object. */

echo "Same in a different format: "
    . $rdfaData['dc:created']->format('r') . "\n";

This will output:

Title: Example data
Creators: Alice, Bob, 
Created at: 2025-10-21T19:09:00+02:00
Same in a different format: Tue, 21 Oct 2025 19:09:00 +0200

Overview

Literals

The classes that implement LiteralInterface represent the concept of RDF Literals, i.e. data elements that may have a datataype and a language tag.

Nodes

The Node class represents the concept of RDF nodes, i.e. URIs which may have RDFa data attached.

RDFa statements

This package manages RDFa statements, providing an interface StmtInterface and three implementation approaches.

The data model assumes that each property has a canonical prefix, such as dc for http://purl.org/dc/terms/ . Thus, the package can deduce that the properties in the above example are the Dublic Core properties title, creator and created, and it can create objects of class DcTitle, DcCreator and DcCreated for them. The latter class knows that its object is a timestamp and is able to output it in various formats.

All statement classes implement the interface StmtInterface.

A number of statement classes is provided, more classes can easily be added.

Some classes know that their object is of a particular data type, such as DateTime for DcCreated. A number of classes have an object which must be or can be an RDFa node, which can itself have RDFa data attached. The class Node is provided for the latter case.

This package focuses on the representation of RDFa statements themselves in PHP, in order to have a unique way to manage metadata wherever they come from or go to.

Other packages may do something useful with these data, for instance alcamo-http creates HTTP headers, and alcamo-html-page creates HTML page headers.

Auxiliary classes

The package also provides some classes needed in RDFa statements which are useful by themselves:


All versions of rdfa with dependencies

PHP Build Version
Package Version
Requires php Version 7.3 - 9.0
alcamo/binary-data Version ^0.6
alcamo/collection Version ^0.2
alcamo/rdf-literal Version ^0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alcamo/rdfa contains the following files

Loading the files please wait ...