Recent Releases of https://github.com/acdh-oeaw/urinormalizer
https://github.com/acdh-oeaw/urinormalizer - Honor proxy settings from env vars
- PHP
Published by zozlak 9 months ago
https://github.com/acdh-oeaw/urinormalizer - Fallback JSON to RDF parsing
UriNormalizer::fetch() now implement a quick & dirty JSON to RDF parsing for services which do not provide RDF or provide a broken RDF but serve a correct JSON data.
Sample result for a ROR entity 05xs36f43:
<https://ror.org/05xs36f43> a <unknownClass> ;
<id0> "https://ror.org/05xs36f43" ;
<established0> "1988" ;
<status0> "active" ;
<types0> "education" ;
<admin> _:genid0 ;
<external_ids> _:genid3, _:genid4, _:genid5 ;
<links> _:genid6 ;
<locations> _:genid7 ;
<names> _:genid9, _:genid10 .
_:genid0
<created> _:genid1 .
_:genid1
<date0> "2018-11-14" ;
<schema_version0> "1.0" ;
<last_modified> _:genid2 .
_:genid2
<date0> "2024-12-11" ;
<schema_version0> "2.1" .
_:genid3
<all0> "grid.441829.2" ;
<type0> "grid" .
_:genid4
<all0> "0000 0001 2226 2288" ;
<type0> "isni" .
_:genid5
<all0> "Q6156506" ;
<type0> "wikidata" .
_:genid6
<type0> "website" ;
<value0> "https://www.ularepublica.cl/" .
_:genid7
<geonames_details> _:genid8 ;
<geonames_id0> "3871336" .
_:genid8
<continent_code0> "SA" ;
<continent_name0> "South America" ;
<country_code0> "CL" ;
<country_name0> "Chile" ;
<country_subdivision_code0> "RM" ;
<country_subdivision_name0> "Santiago Metropolitan" ;
<lat0> "-33.45694" ;
<lng0> "-70.64827" ;
<name0> "Santiago" .
_:genid9
<types0> "acronym" ;
<value0> "ULARE" .
_:genid10
<lang0> "es" ;
<types0> "ror_display" ;
<types1> "label" ;
<value0> "Universidad La República" .
- PHP
Published by zozlak 9 months ago
https://github.com/acdh-oeaw/urinormalizer - Ported from EasyRdf to RdfInterface
Backward-incompatible changes
- Methods taking an
EasyRdf\Resourceinstance as a parameter now take anrdfInterface\DatasetInterfaceinstance instead (acdhOeaw\UriNormalizer::gNormalizeMeta()andacdhOeaw\uriNormalizer::normalizeMeta) - Methods returning an
EasyRdf\Resourceobject now return anrdfInterface\DatasetNodeInterfaceobject instead (acdhOeaw\UriNormalizer::gFetch()andacdhOeaw\UriNormalizer::fetch()).
New features
- Both the constructor and the static
init()method take additional optional parameterrdfInterface\DataFactoryInterface $dataFactoryallowing to specify the RDF terms factory to be used. If not specified, aquickRdf\DataFactoryfrom the sweetrdf\quick-rdf is used - In all methods taking URI parameters they can be now passed both as strings and
rdfInterface\NamedNodeInterfaceobjects. - Two methods returning normalized URI as an
rdfInterface\NamedNodeInterfacewere added:acdhOeaw\uriNormalizer::gNormalizeNN()andacdhOeaw\uriNormalizer::normalizeNN()
- PHP
Published by zozlak about 2 years ago
https://github.com/acdh-oeaw/urinormalizer - Ported from EasyRdf to RdfInterface
Backward-incompatible changes
- Methods taking an
EasyRdf\Resourceinstance as a parameter now take anrdfInterface\DatasetInterfaceinstance instead (acdhOeaw\UriNormalizer::gNormalizeMeta()andacdhOeaw\uriNormalizer::normalizeMeta) - Methods returning an
EasyRdf\Resourceobject now return anrdfInterface\DatasetNodeInterfaceobject instead (acdhOeaw\UriNormalizer::gFetch()andacdhOeaw\UriNormalizer::fetch()).
New features
- Both the constructor and the static
init()method take additional optional parameterrdfInterface\DataFactoryInterface $dataFactoryallowing to specify the RDF terms factory to be used. If not specified, aquickRdf\DataFactoryfrom the sweetrdf\quick-rdf is used - In all methods taking URI parameters they can be now passed both as strings and
rdfInterface\NamedNodeInterfaceobjects. - Two methods returning normalized URI as an
rdfInterface\NamedNodeInterfacewere added:acdhOeaw\uriNormalizer::gNormalizeNN()andacdhOeaw\uriNormalizer::normalizeNN()
- PHP
Published by zozlak about 2 years ago
https://github.com/acdh-oeaw/urinormalizer - Ported from EasyRdf to RdfInterface
Backward-incompatible changes
- Methods taking an
EasyRdf\Resourceinstance as a parameter now take anrdfInterface\DatasetInterfaceinstance instead (acdhOeaw\UriNormalizer::gNormalizeMeta()andacdhOeaw\uriNormalizer::normalizeMeta) - Methods returning an
EasyRdf\Resourceobject now return anrdfInterface\DatasetNodeInterfaceobject instead (acdhOeaw\UriNormalizer::gFetch()andacdhOeaw\UriNormalizer::fetch()).
New features
- Both the constructor and the static
init()method take additional optional parameterrdfInterface\DataFactoryInterface $dataFactoryallowing to specify the RDF terms factory to be used. If not specified, aquickRdf\DataFactoryfrom the sweetrdf\quick-rdf is used - In all methods taking URI parameters they can be now passed both as strings and
rdfInterface\NamedNodeInterfaceobjects. - Two methods returning normalized URI as an
rdfInterface\NamedNodeInterfacewere added:acdhOeaw\uriNormalizer::gNormalizeNN()andacdhOeaw\uriNormalizer::normalizeNN()
- PHP
Published by zozlak over 2 years ago
https://github.com/acdh-oeaw/urinormalizer - 2.0.0
Backward-incompatible changes
acdhOeaw\UriNormalizer::factory()method dropped - use constructor with$mappingsequalnullinstead.acdhOeaw\UriNormalizer::normalize(),acdhOeaw\UriNormalizer::gNormalize(),acdhOeaw\UriNormalizer::gNormalizeMeta()andacdhOeaw\UriNormalizer::normalizeMeta()take additional optional parameter$requireMatchwith a default value oftruecausingacdhOeaw\UriNormalizerExceptionto be thrown if an URI matches no rules.
New features
acdhOeaw\UriNormalizer::init()and acdhOeaw\UriNormalizer::__construct()`:- Allow
$mappingsto benull- in such a case normalization rules are taken from theacdhOeaw\UriNormRules::getRules() - Take optional
Psr\Http\Client\ClientInterface $clientparameter allowing to provide an HTTP client to be used by theresolve()andfetch()methods. If not provided, an automatically createdGuzzleHttp\ClientHTTP client is used. - Take optional
$cacheparameter controllingnormalize(),fetch()andresolve()results caching. It should be an object implementing thePsr\SimpleCache\CacheInterface, e.g. theacdhOeaw\UriNormalizerCache.
- Allow
acdhOeaw\UriNormalizer::normalize()andacdhOeaw\UriNormalizer::gNormalize()take optional second parameter$requireMatchwith a default value oftruecausingacdhOeaw\UriNormalizerExceptionto be thrown if an URI matches no rules.acdhOeaw\UriNormalizerExceptionis being thrown instead of theRuntimeException(this is backward compatible change as theacdhOeaw\UriNormalizerExceptionextends theRuntimeException)- New method
acdhOeaw\UriNormalizer::resolve(string $uri): GuzzleHttp\Psr7\Responseand its static counterpartacdhOeaw\UriNormalizer::gResolve()added. It returns a PSR-7 response object containing an RDF metadata of the$urientity. - New method
acdhOeaw\UriNormalizer::fetch(string $uri): EasyRdf\Resourceand its static counterpartacdhOeaw\UriNormalizer::gFetch()added. It returns an EasyRdf resource object containing an RDF metadata of$urientity. acdhOeaw\UriNormalizerCacheclass introduced implementing in memory or combined in memory and SQlite-based caching for theacdhOeaw\UriNormalizer.
- PHP
Published by zozlak over 3 years ago
https://github.com/acdh-oeaw/urinormalizer - Adjusted to change in dependency package name
- PHP
Published by zozlak almost 5 years ago
https://github.com/acdh-oeaw/urinormalizer - Coupled with acdh-oeaw/uri-norm-rules
The default mappings are now taken from acdh-oeaw/uri-norm-rules which provides easier mappings maintenance on the ACDH level.
- PHP
Published by zozlak over 5 years ago
https://github.com/acdh-oeaw/urinormalizer - Documentation fixes
- PHP
Published by zozlak almost 6 years ago
https://github.com/acdh-oeaw/urinormalizer - Initial release
- PHP
Published by zozlak over 6 years ago