Download the PHP package alcamo/rdf-literal-workbench without Composer

On this page you can find all versions of the php package alcamo/rdf-literal-workbench. 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 rdf-literal-workbench

Usage example

namespace alcamo\rdf_literal_workbench;

use alcamo\rdf_literal\StringLiteral;
use alcamo\uri\FileUriFactory;

include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';

$factory = new LiteralFactory();

$factory->getSchema()->addUris(
    [
        (new FileUriFactory)->create(
            dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor'
                . DIRECTORY_SEPARATOR . 'alcamo'
                . DIRECTORY_SEPARATOR . 'dom'
                . DIRECTORY_SEPARATOR . 'xsd'
                . DIRECTORY_SEPARATOR . 'xhtml-datatypes-1.xsd'
        )
    ]
);

$ncNameType =
    $factory->getSchema()->getGlobalType(LiteralFactory::XH11D_NS . ' Pixels');

$literal1 = $factory->create(1024, $ncNameType);

echo "$literal1: class " . get_class($literal1) . PHP_EOL;

$typeMap = new LiteralTypeMap();

$typeMap->validateLiteral($literal1);

$literal2 = new StringLiteral('foo', LiteralFactory::XSD_NS . '#QName');

$typeMap->validateLiteral($literal2);

This example is contained in this package as a file in the bin directory. It will output

1024: class alcamo\rdf_literal\NonNegativeIntegerLiteral
PHP Fatal error:  Uncaught alcamo\exception\DataValidationFailed: Validation failed; literal datatype http://www.w3.org/2001/XMLSchema QName not derived from default datatype http://www.w3.org/2001/XMLSchema string in /home/rve/src/alcamo-rdf-literal-workbench/src/LiteralTypeMap.php:62

Unlike alcamo\rdf_literal\LiteralFactory, the class alcamo\rdf_literal_workbench\LiteralFactory contains an XML schema and hence is aware of the type hierarchy. Thus, the above call to create() creates an instance of NonNegativeIntegerLiteral since the factory knows that the simple type xh11d:Pixels is derived from xsd:NonNegativeInteger.

The class alcamo\rdf_literal\LiteralTypeMap, which contains an XML Schema as well, can be used to validate whether the datatype of a literal is actually supported by the literal class, i.e. derived from its defaut type. In the above example, $literal1 is valid while $literal2 is not. The literal classes themselves do not check this because they would need an XML schema for this.

See the doxygen documentation for details.


All versions of rdf-literal-workbench with dependencies

PHP Build Version
Package Version
Requires php Version 7.3 - 8.5
alcamo/dom Version 0.16 - 0.19
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/rdf-literal-workbench contains the following files

Loading the files please wait ...