Recent Releases of https://github.com/acdh-oeaw/urinormalizer

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\Resource instance as a parameter now take an rdfInterface\DatasetInterface instance instead (acdhOeaw\UriNormalizer::gNormalizeMeta() and acdhOeaw\uriNormalizer::normalizeMeta)
  • Methods returning an EasyRdf\Resource object now return an rdfInterface\DatasetNodeInterface object instead (acdhOeaw\UriNormalizer::gFetch() and acdhOeaw\UriNormalizer::fetch()).

New features

  • Both the constructor and the static init() method take additional optional parameter rdfInterface\DataFactoryInterface $dataFactory allowing to specify the RDF terms factory to be used. If not specified, a quickRdf\DataFactory from the sweetrdf\quick-rdf is used
  • In all methods taking URI parameters they can be now passed both as strings and rdfInterface\NamedNodeInterface objects.
  • Two methods returning normalized URI as an rdfInterface\NamedNodeInterface were added: acdhOeaw\uriNormalizer::gNormalizeNN() and acdhOeaw\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\Resource instance as a parameter now take an rdfInterface\DatasetInterface instance instead (acdhOeaw\UriNormalizer::gNormalizeMeta() and acdhOeaw\uriNormalizer::normalizeMeta)
  • Methods returning an EasyRdf\Resource object now return an rdfInterface\DatasetNodeInterface object instead (acdhOeaw\UriNormalizer::gFetch() and acdhOeaw\UriNormalizer::fetch()).

New features

  • Both the constructor and the static init() method take additional optional parameter rdfInterface\DataFactoryInterface $dataFactory allowing to specify the RDF terms factory to be used. If not specified, a quickRdf\DataFactory from the sweetrdf\quick-rdf is used
  • In all methods taking URI parameters they can be now passed both as strings and rdfInterface\NamedNodeInterface objects.
  • Two methods returning normalized URI as an rdfInterface\NamedNodeInterface were added: acdhOeaw\uriNormalizer::gNormalizeNN() and acdhOeaw\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\Resource instance as a parameter now take an rdfInterface\DatasetInterface instance instead (acdhOeaw\UriNormalizer::gNormalizeMeta() and acdhOeaw\uriNormalizer::normalizeMeta)
  • Methods returning an EasyRdf\Resource object now return an rdfInterface\DatasetNodeInterface object instead (acdhOeaw\UriNormalizer::gFetch() and acdhOeaw\UriNormalizer::fetch()).

New features

  • Both the constructor and the static init() method take additional optional parameter rdfInterface\DataFactoryInterface $dataFactory allowing to specify the RDF terms factory to be used. If not specified, a quickRdf\DataFactory from the sweetrdf\quick-rdf is used
  • In all methods taking URI parameters they can be now passed both as strings and rdfInterface\NamedNodeInterface objects.
  • Two methods returning normalized URI as an rdfInterface\NamedNodeInterface were added: acdhOeaw\uriNormalizer::gNormalizeNN() and acdhOeaw\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 $mappings equal null instead.
  • acdhOeaw\UriNormalizer::normalize(), acdhOeaw\UriNormalizer::gNormalize(), acdhOeaw\UriNormalizer::gNormalizeMeta() and acdhOeaw\UriNormalizer::normalizeMeta() take additional optional parameter $requireMatch with a default value of true causing acdhOeaw\UriNormalizerException to be thrown if an URI matches no rules.

New features

  • acdhOeaw\UriNormalizer::init() and acdhOeaw\UriNormalizer::__construct()`:
    • Allow $mappings to be null - in such a case normalization rules are taken from the acdhOeaw\UriNormRules::getRules()
    • Take optional Psr\Http\Client\ClientInterface $client parameter allowing to provide an HTTP client to be used by the resolve() and fetch() methods. If not provided, an automatically created GuzzleHttp\Client HTTP client is used.
    • Take optional $cache parameter controlling normalize(), fetch() and resolve() results caching. It should be an object implementing the Psr\SimpleCache\CacheInterface, e.g. the acdhOeaw\UriNormalizerCache.
  • acdhOeaw\UriNormalizer::normalize() and acdhOeaw\UriNormalizer::gNormalize() take optional second parameter $requireMatch with a default value of true causing acdhOeaw\UriNormalizerException to be thrown if an URI matches no rules.
  • acdhOeaw\UriNormalizerException is being thrown instead of the RuntimeException (this is backward compatible change as the acdhOeaw\UriNormalizerException extends the RuntimeException)
  • New method acdhOeaw\UriNormalizer::resolve(string $uri): GuzzleHttp\Psr7\Response and its static counterpart acdhOeaw\UriNormalizer::gResolve() added. It returns a PSR-7 response object containing an RDF metadata of the $uri entity.
  • New method acdhOeaw\UriNormalizer::fetch(string $uri): EasyRdf\Resource and its static counterpart acdhOeaw\UriNormalizer::gFetch() added. It returns an EasyRdf resource object containing an RDF metadata of $uri entity.
  • acdhOeaw\UriNormalizerCache class introduced implementing in memory or combined in memory and SQlite-based caching for the acdhOeaw\UriNormalizer.

- PHP
Published by zozlak over 3 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