Commit 02b19f34 authored by webchick's avatar webchick

Issue #2173653 by kay_v, scor: Update easyrdf/easyrdf to 0.8.0.

parent 129cd90f
......@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "ac2a8ee2f49fcb0535259847306a2bdc",
"hash": "0733d59446085cb815b72923c37e0fd6",
"packages": [
{
"name": "doctrine/annotations",
......@@ -400,16 +400,16 @@
},
{
"name": "easyrdf/easyrdf",
"version": "0.8.0-beta.1",
"version": "0.8.0",
"source": {
"type": "git",
"url": "git://github.com/njh/easyrdf.git",
"reference": "0.8.0-beta.1"
"url": "https://github.com/njh/easyrdf.git",
"reference": "3e43ab7274004e9f4192e06b9fc147781e1f85c2"
},
"dist": {
"type": "zip",
"url": "https://github.com/njh/easyrdf/archive/0.8.0-beta.1.zip",
"reference": "0.8.0-beta.1",
"url": "https://api.github.com/repos/njh/easyrdf/zipball/3e43ab7274004e9f4192e06b9fc147781e1f85c2",
"reference": "3e43ab7274004e9f4192e06b9fc147781e1f85c2",
"shasum": ""
},
"require": {
......@@ -423,6 +423,9 @@
"sami/sami": "dev-master",
"squizlabs/php_codesniffer": ">=1.4.3"
},
"suggest": {
"ml/json-ld": "dev-master"
},
"type": "library",
"autoload": {
"psr-0": {
......@@ -448,9 +451,10 @@
"RDF",
"Semantic Web",
"Turtle",
"rdfa"
"rdfa",
"sparql"
],
"time": "2013-01-18 15:54:28"
"time": "2013-12-30 22:31:37"
},
{
"name": "guzzle/common",
......@@ -2134,8 +2138,7 @@
"doctrine/common": 20,
"doctrine/annotations": 20,
"kriswallsmith/assetic": 15,
"symfony-cmf/routing": 15,
"easyrdf/easyrdf": 10
"symfony-cmf/routing": 15
},
"platform": [
......
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit8448fbbf88ecb044f224057d631a4472::getLoader();
return ComposerAutoloaderInit92462a247bf83504e990c5f706f228cc::getLoader();
......@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8448fbbf88ecb044f224057d631a4472
class ComposerAutoloaderInit92462a247bf83504e990c5f706f228cc
{
private static $loader;
......@@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8448fbbf88ecb044f224057d631a4472', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit92462a247bf83504e990c5f706f228cc', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit8448fbbf88ecb044f224057d631a4472', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit92462a247bf83504e990c5f706f228cc', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
......
[
{
"name": "easyrdf/easyrdf",
"version": "0.8.0-beta.1",
"version_normalized": "0.8.0.0-beta1",
"source": {
"type": "git",
"url": "git://github.com/njh/easyrdf.git",
"reference": "0.8.0-beta.1"
},
"dist": {
"type": "zip",
"url": "https://github.com/njh/easyrdf/archive/0.8.0-beta.1.zip",
"reference": "0.8.0-beta.1",
"shasum": ""
},
"require": {
"php": ">=5.2.8"
},
"replace": {
"njh/easyrdf": "self.version"
},
"require-dev": {
"phpunit/phpunit": ">=3.5.15",
"sami/sami": "dev-master",
"squizlabs/php_codesniffer": ">=1.4.3"
},
"time": "2013-01-18 15:54:28",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"EasyRdf_": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nicholas Humfrey",
"email": "njh@aelius.com",
"homepage": "http://www.aelius.com/njh/",
"role": "Developer"
}
],
"description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.",
"homepage": "http://www.easyrdf.org/",
"keywords": [
"Linked Data",
"RDF",
"Semantic Web",
"Turtle",
"rdfa"
]
},
{
"name": "psr/log",
"version": "1.0.0",
......@@ -2193,5 +2137,65 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com"
},
{
"name": "easyrdf/easyrdf",
"version": "0.8.0",
"version_normalized": "0.8.0.0",
"source": {
"type": "git",
"url": "https://github.com/njh/easyrdf.git",
"reference": "3e43ab7274004e9f4192e06b9fc147781e1f85c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/njh/easyrdf/zipball/3e43ab7274004e9f4192e06b9fc147781e1f85c2",
"reference": "3e43ab7274004e9f4192e06b9fc147781e1f85c2",
"shasum": ""
},
"require": {
"php": ">=5.2.8"
},
"replace": {
"njh/easyrdf": "self.version"
},
"require-dev": {
"phpunit/phpunit": ">=3.5.15",
"sami/sami": "dev-master",
"squizlabs/php_codesniffer": ">=1.4.3"
},
"suggest": {
"ml/json-ld": "dev-master"
},
"time": "2013-12-30 22:31:37",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"EasyRdf_": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nicholas Humfrey",
"email": "njh@aelius.com",
"homepage": "http://www.aelius.com/njh/",
"role": "Developer"
}
],
"description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.",
"homepage": "http://www.easyrdf.org/",
"keywords": [
"Linked Data",
"RDF",
"Semantic Web",
"Turtle",
"rdfa",
"sparql"
]
}
]
EasyRdf 0.8.0
=============
API changes
-----------
* is_a() has been renamed to isA()
Major new features
------------------
* Now PSR-2 compliant
* Added RDFa parser
* Added SPARQL Update support to `EasyRdf_Sparql_Client`
API changes
-----------
* `is_a()` has been renamed to `isA()`
* `isBnode()` has been renamed to `isBNode()`
* `getNodeId()` has been renamed to `getBNodeId()`
* Added a `$value` property to `hasProperty()`
* Renamed `toArray()` to `toRdfPhp()`
* Renamed `count()` to `countValues()` in `EasyRdf_Graph` and `EasyRdf_Resource`
* Made passing a URI to `delete()` behave more like `all()` and `get()` - you must enclose in `<>`
* `dump(true)` has changed to `dump('html')`
* `getUri()` in `EasyRdf_Sparql_Client` has been renamed to `getQueryUri()`
Enhancements
------------
* Added `EasyRdf_Container` class to help iterate through `rdf:Alt`, `rdf:Bag` and `rdf:Seq`
* Added `EasyRdf_Collection` class to help iterate through `rdf:List`
* Added `EasyRdf_Literal_HTML` and `EasyRdf_Literal_XML`
* Changed formatting of `xsd:dateTime` from `DateTime::ISO8601` to `DateTime::ATOM`
* Added `rss:title` to the list of properties that `label()` will check for
* Added support for serialising containers to the RDF/XML serialiser
* Added getGraph method to `EasyRdf_Resource`
* Turtle parser improvements
* Added the `application/n-triples` MIME type for the N-Triples format
* Added support to `EasyRdf_Namespace` for expanding `a` to `rdf:type`
* Added `listNamedGraphs()` function to `EasyRdf_Sparql_Client`
* Added line and column number to exceptions in the built-in parsers
Bug Fixes
---------
* Fixed bug in `EasyRdf_Namespace::expand()` (see issue #114)
* Fix for dumping SPARQL SELECT query with unbound result (see issue #112)
* Sesame compatibility : avoid duplicate Content-Length header
* Fix for for passing objects of type DateTime to $graph->add() (see issue #119)
* Fix for SPARQL queries longer than 2KB (see issue #85)
* Fix for dumping literal with unshortenable datatype uri (see issue #120)
* Fix for getting default mime type or extension when there isn't one
* Fix for missing trailing slash the HTTP client
EasyRdf 0.7.2
......
Contributing to EasyRdf
=======================
Contributions to the EasyRdf codebase are welcome using the usual Github pull request workflow.
To run the code style checker:
```
make cs
```
You can run the PHP unit test suite with:
```
make test
```
Unit tests are automatically run after being received by Github:
http://ci.aelius.com/job/easyrdf/
The tests for the examples are run in a sperate test:
http://ci.aelius.com/job/easyrdf-examples/
Notes
-----
* Please ask on the [mailing list] before starting work on any significant chnages
* Please write tests for any new features or bug fixes. The tests should be checked in the same commit as the code.
[mailing list]:http://groups.google.com/group/easyrdf
......@@ -29,14 +29,14 @@ an [EasyRdf_Graph] object.
Downloads
---------
The latest version of EasyRdf can be [downloaded from GitHub].
The latest _stable_ version of EasyRdf can be [downloaded from the EasyRdf website].
Links
-----
* [EasyRdf Homepage](http://www.easyrdf.org/)
* [API documentation](http://www.easyrdf.org/docs/api/)
* [API documentation](http://www.easyrdf.org/docs/api)
* [Change Log](http://github.com/njh/easyrdf/blob/master/CHANGELOG.md)
* Source Code: <http://github.com/njh/easyrdf>
* Issue Tracker: <http://github.com/njh/easyrdf/issues>
......@@ -86,6 +86,7 @@ More Examples
* [zend_framework.php](https://github.com/njh/easyrdf/blob/master/examples/zend_framework.php#slider) - Example of using Zend_Http_Client and Zend_Loader_Autoloader with EasyRdf
Licensing
---------
......@@ -101,7 +102,7 @@ The examples are in the public domain, for more information see [UNLICENSE].
[ARC2]:http://github.com/semsol/arc2/
[BSD-3-Clause]:http://www.opensource.org/licenses/BSD-3-Clause
[downloaded from github]:https://github.com/njh/easyrdf/downloads
[downloaded from the EasyRdf website]:http://www.easyrdf.org/downloads
[GraphViz]:http://www.graphviz.org/
[rapper]:http://librdf.org/raptor/rapper.html
[RDF]:http://en.wikipedia.org/wiki/Resource_Description_Framework
......
{
"name": "easyrdf/easyrdf",
"description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.",
"version": "0.8.0-beta.1",
"version": "0.8.0",
"type": "library",
"keywords": ["RDF", "Semantic Web", "Linked Data", "Turtle", "RDFa"],
"keywords": ["RDF", "Semantic Web", "Linked Data", "Turtle", "RDFa", "SPARQL"],
"homepage": "http://www.easyrdf.org/",
"license": "BSD-3-Clause",
"authors": [
......@@ -22,6 +22,9 @@
"require": {
"php": ">=5.2.8"
},
"suggest": {
"ml/json-ld": "dev-master"
},
"require-dev": {
"phpunit/PHPUnit": ">=3.5.15",
"squizlabs/php_codesniffer": ">=1.4.3",
......
......@@ -27,8 +27,8 @@
$easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/Resource_Description_Framework');
$easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/PHP');
$easyrdf->addResource('doap:category', 'http://dbpedialite.org/things/24131#id');
$easyrdf->addResource('doap:category', 'http://dbpedialite.org/things/53847#id');
$easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/24131#id');
$easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/53847#id');
$repository = $doap->newBNode('doap:GitRepository');
$repository->addResource('doap:browse', 'http://github.com/njh/easyrdf');
......
......@@ -8,7 +8,7 @@
*
* LICENSE
*
* Copyright (c) 2009-2011 Nicholas J Humfrey. All rights reserved.
* Copyright (c) 2009-2013 Nicholas J Humfrey. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
......@@ -34,9 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package EasyRdf
* @copyright Copyright (c) 2011 Nicholas J Humfrey
* @copyright Copyright (c) 2011-2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
* @version $Id$
*/
/**
......@@ -74,6 +73,11 @@
*/
require_once "EasyRdf/Http/Response.php";
/**
* @see EasyRdf_Isomorphic
*/
require_once "EasyRdf/Isomorphic.php";
/**
* @see EasyRdf_Namespace
*/
......@@ -134,6 +138,11 @@
*/
require_once "EasyRdf/Parser.php";
/**
* @see EasyRdf_Parser_Exception
*/
require_once "EasyRdf/Parser/Exception.php";
/**
* @see EasyRdf_Parser_RdfPhp
*/
......@@ -169,6 +178,16 @@
*/
require_once "EasyRdf/Resource.php";
/**
* @see EasyRdf_Collection
*/
require_once "EasyRdf/Collection.php";
/**
* @see EasyRdf_Container
*/
require_once "EasyRdf/Container.php";
/**
* @see EasyRdf_Serialiser
*/
......
This diff is collapsed.
<?php
/**
* EasyRdf
*
* LICENSE
*
* Copyright (c) 2013 Nicholas J Humfrey. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author 'Nicholas J Humfrey" may be used to endorse or
* promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @package EasyRdf
* @copyright Copyright (c) 2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
*/
/**
* Sub-class of EasyRdf_Resource that represents an RDF container
* (rdf:Alt, rdf:Bag and rdf:Seq)
*
* This class can be used to iterate through a list of items.
*
* @package EasyRdf
* @link http://www.w3.org/TR/xmlschema-2/#date
* @copyright Copyright (c) 2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class EasyRdf_Container extends EasyRdf_Resource implements ArrayAccess, Countable, SeekableIterator
{
private $position;
/** Create a new container - do not use this directly
*
* @ignore
*/
public function __construct($uri, $graph)
{
$this->position = 1;
parent::__construct($uri, $graph);
}
/** Seek to a specific position in the container
*
* The first item is postion 1
*
* @param integer $position The position in the container to seek to
* @throws OutOfBoundsException
*/
public function seek($position)
{
if (is_int($position) and $position > 0) {
if ($this->hasProperty('rdf:_'.$position)) {
$this->position = $position;
} else {
throw new OutOfBoundsException(
"Unable to seek to position $position in the container"
);
}
} else {
throw new InvalidArgumentException(
"Container position must be a positive integer"
);
}
}
/** Rewind the iterator back to the start of the container (item 1)
*
*/
public function rewind()
{
$this->position = 1;
}
/** Return the current item in the container
*
* @return mixed The current item
*/
public function current()
{
return $this->get('rdf:_'.$this->position);
}
/** Return the key / current position in the container
*
* @return int The current position
*/
public function key()
{
return $this->position;
}
/** Move forward to next item in the container
*
*/
public function next()
{
$this->position++;
}
/** Checks if current position is valid
*
* @return bool True if the current position is valid
*/
public function valid()
{
return $this->hasProperty('rdf:_'.$this->position);
}
/** Counts the number of items in the container
*
* Note that this is an slow method - it is more efficient to use
* the iterator interface, if you can.
*
* @return integer The number of items in the container
*/
public function count()
{
$pos = 1;
while ($this->hasProperty('rdf:_'.$pos)) {
$pos++;
}
return $pos - 1;
}
/** Append an item to the end of the container
*
* @param mixed $value The value to append
* @return integer The number of values appended (1 or 0)
*/
public function append($value)
{
// Find the end of the list
$pos = 1;
while ($this->hasProperty('rdf:_'.$pos)) {
$pos++;
}
// Add the item
return $this->add('rdf:_'.$pos, $value);
}
/** Array Access: check if a position exists in container using array syntax
*
* Example: isset($seq[2])
*/
public function offsetExists($offset)
{
if (is_int($offset) and $offset > 0) {
return $this->hasProperty('rdf:_'.$offset);
} else {
throw new InvalidArgumentException(
"Container position must be a positive integer"
);
}
}
/** Array Access: get an item at a specified position in container using array syntax
*
* Example: $item = $seq[2];
*/
public function offsetGet($offset)
{
if (is_int($offset) and $offset > 0) {
return $this->get('rdf:_'.$offset);
} else {
throw new InvalidArgumentException(
"Container position must be a positive integer"
);
}
}
/**
* Array Access: set an item at a positon in container using array syntax
*
* Example: $seq[2] = $item;
*
* Warning: creating gaps in the sequence will result in unexpected behavior
*/
public function offsetSet($offset, $value)
{
if (is_int($offset) and $offset > 0) {
return $this->set('rdf:_'.$offset, $value);
} elseif (is_null($offset)) {
return $this->append($value);
} else {
throw new InvalidArgumentException(
"Container position must be a positive integer"
);
}
}
/**
* Array Access: delete an item at a specific postion using array syntax
*
* Example: unset($seq[2]);
*
* Warning: creating gaps in the sequence will result in unexpected behavior
*/
public function offsetUnset($offset)
{
if (is_int($offset) and $offset > 0) {
return $this->delete('rdf:_'.$offset);
} else {
throw new InvalidArgumentException(
"Container position must be a positive integer"
);
}
}
}
......@@ -5,7 +5,7 @@
*
* LICENSE
*
* Copyright (c) 2009-2010 Nicholas J Humfrey. All rights reserved.
* Copyright (c) 2009-2013 Nicholas J Humfrey. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
......@@ -31,9 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package EasyRdf
* @copyright Copyright (c) 2009-2010 Nicholas J Humfrey
* @copyright Copyright (c) 2009-2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
* @version $Id$
*/
/**
......@@ -42,7 +41,7 @@
* All exceptions thrown by EasyRdf are an instance of this class.
*
* @package EasyRdf
* @copyright Copyright (c) 2009-2010 Nicholas J Humfrey
* @copyright Copyright (c) 2009-2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class EasyRdf_Exception extends Exception
......
......@@ -5,7 +5,7 @@
*
* LICENSE
*
* Copyright (c) 2009-2012 Nicholas J Humfrey. All rights reserved.
* Copyright (c) 2009-2013 Nicholas J Humfrey. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
......@@ -31,9 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package EasyRdf
* @copyright Copyright (c) 2009-2012 Nicholas J Humfrey
* @copyright Copyright (c) 2009-2013 Nicholas J Humfrey