Download the PHP package acdh-oeaw/uri-normalizer without Composer
On this page you can find all versions of the php package acdh-oeaw/uri-normalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download acdh-oeaw/uri-normalizer
More information about acdh-oeaw/uri-normalizer
Files in acdh-oeaw/uri-normalizer
Package uri-normalizer
Short Description A simple class for normalizing external entity reference sources' URIs (Geonames, GND, etc. URIs).
License MIT
Homepage https://github.com/acdh-oeaw/uriNormalizer
Informations about the package uri-normalizer
URI Normalizer
A class for normalizing named entity URIs from services like Geonames, GND, VIAF, ORCID, etc. and retrieving RDF metadata from them.
By default the rules from the arche-assets library are used by you can supply your own ones.
Any PSR-16 compatible cache can be used to speed up normalization/retrieval of reccuring URIs. A combined in-memory and persistent sqlite-based cache implementation is provided as well.
Context
While looking at the named entity database services it's quite often difficult to tell which URL is a canonical URI for a given named entity.
Just let's take a quick look at a bunch (there are definitely more) of Geonames URLs describing exactly same Geonames named entity with id 2761369:
- http://geonames.org/2761369
- https://geonames.org/2761369
- http://www.geonames.org/2761369
- https://www.geonames.org/2761369
- http://geonames.org/2761369/vienna
- https://geonames.org/2761369/vienna
- http://www.geonames.org/2761369/vienna
- https://www.geonames.org/2761369/vienna
- https://www.geonames.org/2761369/vienna/about.rdf
- https://www.geonames.org/2761369/vienna.html
Which one of them is the right one? The actual answer is quite simple - the one used as an RDF triples subject in the RDF metadata returned by a given service. So the first aim of this package is to provide a tool for transforming any URL coming from a given service and transform it into the canonical URI used by the service in the RDF metadata it returns.
But here we come to another issue - how to fetch the RDF metadata for a given named entity knowing its URI?
For some services (like ORCID or VIAF) it can be done just with an HTTP content negotation by requesting response in one of supported RDF formats. For other though you need to know a service-specific content negotation method, e.g. in Geonames you need to append /about.rdf
to the canonical URI.
The second aim of this package is to allow you to retrieve RDF metadata from named entity URIs/URLs without being bothered by all those service-specific peculiarities.
And as such a retrieval involves quite some time, a caching option is also provided.
Automatically generated documentation
https://acdh-oeaw.github.io/arche-docs/devdocs/classes/acdhOeaw-UriNormalizer.html
Installation
Usage
All versions of uri-normalizer with dependencies
acdh-oeaw/arche-assets Version ^3.5
sweetrdf/quick-rdf Version ^2
sweetrdf/quick-rdf-io Version ^1.0.7
guzzlehttp/guzzle Version ^7.5
psr/simple-cache Version ^3.0