Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Graph::properties() and Resource::properties() methods don't return properties in unknown namespaces #349

Open
njh opened this issue Aug 2, 2020 · 0 comments
Labels

Comments

@njh
Copy link
Collaborator

njh commented Aug 2, 2020

Originally raised by @zozlak here:
https://github.com/sweetyrdf/easyrdf/issues/17

$g = new EasyRdf\Graph();
$r = $g->resource('http://sample/resource');
$r->addLiteral('dc:title', 'sample title');
$r->addLiteral('http://unknown.namespace/property', 'sample value');
print_r($r->properties());
print_r($r->propertyUris());

gives

Array(
    [0] => dc:title
)
Array(
    [0] => http://purl.org/dc/terms/title
    [1] => http://unknown.namespace/property
)

The unexpected result is caused by https://github.com/easyrdf/easyrdf/blob/master/lib/Graph.php#L1247-L1250 which silently skips all properties within namespaces unknown to EasyRdf\RdfNamespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants