Giter VIP home page Giter VIP logo

jsonld's Introduction

Islandora-JSON-LD JSONLD

Build Status Contribution Guidelines LICENSE

Introduction

JSON-LD Serializer for Drupal 10 and Islandora.

NOTE: This 3.x branch is compatible with Drupal 10. For progress in D10 compatibility with the rest of Islandora, see ticket.

This module adds a simple Drupal entity to JSON-LD normalizer/serializer/unserializer service provider and a few supporting classes. It depends on RDF module and existing fields to RDF properties mappings to do its job.

Configuration

The JSON-LD normalizer adds a ?_format=jsonld to all URIs by default.

You can disable this via a checkbox in the Configuration -> Search and Metadata -> JsonLD form.

Maintainers

Current maintainers:

Development

If you would like to contribute, please get involved by attending our weekly Tech Call. We love to hear from you!

If you would like to contribute code to the project, you need to be covered by an Islandora Foundation Contributor License Agreement or Corporate Contributor License Agreement. Please see the Contributors pages on Islandora.ca for more information.

We recommend using the islandora-playbook to get started.

License

GPLv2

jsonld's People

Contributors

ajstanley avatar amandarl avatar dannylamb avatar diegopino avatar elizoller avatar islandora-community avatar jonathangreen avatar jyobb avatar kimpham54 avatar manez avatar rosiel avatar ruebot avatar seth-shaw-asu avatar seth-shaw-unlv avatar whikloj avatar ysuarez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonld's Issues

[BUG] Undefined index: @id in deduplicateArrayOfIds()

I've started getting the following errors popping up in my error queue:

Notice: Undefined index: @id in Drupal\jsonld\Normalizer\NormalizerBase::deduplicateArrayOfIds() (line 110 of /data/www/special/drupal/modules/contrib/jsonld/src/Normalizer/NormalizerBase.php)
#0 /data/www/special/drupal/core/includes/bootstrap.inc(346): _drupal_error_handler_real()
#1 /data/www/special/drupal/modules/contrib/jsonld/src/Normalizer/NormalizerBase.php(110): _drupal_error_handler()
#2 /data/www/special/drupal/modules/contrib/jsonld/src/Normalizer/NormalizerBase.php(86): Drupal\jsonld\Normalizer\NormalizerBase::deduplicateArrayOfIds()
#3 /data/www/special/drupal/modules/contrib/jsonld/src/Normalizer/ContentEntityNormalizer.php(174): Drupal\jsonld\Normalizer\NormalizerBase::deduplicateTypesAndReferences()
#4 /data/www/special/drupal/vendor/symfony/serializer/Serializer.php(153): Drupal\jsonld\Normalizer\ContentEntityNormalizer->normalize()
#5 /data/www/special/drupal/vendor/symfony/serializer/Serializer.php(126): Symfony\Component\Serializer\Serializer->normalize()
#6 /data/www/special/drupal/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php(160): Symfony\Component\Serializer\Serializer->serialize()
#7 /data/www/special/drupal/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php(75): Drupal\rest\EventSubscriber\ResourceResponseSubscriber->renderResponseBody()
#8 [internal function]: Drupal\rest\EventSubscriber\ResourceResponseSubscriber->onResponse()
#9 /data/www/special/drupal/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#10 /data/www/special/drupal/vendor/symfony/http-kernel/HttpKernel.php(191): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#11 /data/www/special/drupal/vendor/symfony/http-kernel/HttpKernel.php(179): Symfony\Component\HttpKernel\HttpKernel->filterResponse()
#12 /data/www/special/drupal/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#13 /data/www/special/drupal/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#14 /data/www/special/drupal/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#15 /data/www/special/drupal/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#16 /data/www/special/drupal/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#17 /data/www/special/drupal/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#18 /data/www/special/drupal/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#19 /data/www/special/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#20 /data/www/special/drupal/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#21 /data/www/special/drupal/index.php(19): Drupal\Core\DrupalKernel->handle()
#22 {main}
.

I'm not sure what it is complaining about, because none of the referenced objects in the JSON-LD that triggered it are missing an @id property:

{
  "@graph": [
    {
      "@id": "https://special.library.unlv.edu/node/338459",
      "@type": [
        "http://pcdm.org/models#Object",
        "http://purl.org/coar/resource_type/c_c513"
      ],
      "http://purl.org/dc/terms/title": [
        {
          "@value": "Photographs of Highland Girl Scout Cookout, Foster Parent's home opening, Reverend Walker's church, adult education graduation at Madison, Las Vegas (Nev.), 1967",
          "@language": "en"
        }
      ],
      "http://schema.org/dateCreated": [
        {
          "@value": "2020-11-09T21:56:37+00:00",
          "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        }
      ],
      "http://schema.org/dateModified": [
        {
          "@value": "2022-06-06T20:45:58+00:00",
          "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
        }
      ],
      "http://purl.org/dc/terms/description": [
        {
          "@value": "<p>Unidentified men at the grand opening of Foster Parents Home. Two men shaking hands in front of a church. A graduation ceremony.</p>\r\n",
          "@language": "en"
        }
      ],
      "http://purl.org/dc/terms/isPartOf": [
        {
          "@id": "https://special.library.unlv.edu/node/297751"
        }
      ],
      "http://purl.org/dc/terms/identifier": [
        {
          "@id": "http://n2t.net/ark:/62930/d1dj58n38"
        },
        {
          "@value": "pho022087",
          "@type": "http://www.w3.org/2001/XMLSchema#string"
        }
      ],
      "http://schema.org/sameAs": [
        {
          "@id": "http://n2t.net/ark:/62930/d1dj58n38"
        },
        {
          "@id": "https://special.library.unlv.edu/node/338459"
        }
      ],
      "http://purl.org/dc/terms/bibliographicCitation": [
        {
          "@value": "<p>pho022087. Clinton Wright Photographic Negatives Collection. PH-00379. Special Collections and Archives, University Libraries, University of Nevada, Las Vegas. Las Vegas, Nevada. http://n2t.net/ark:/62930/d1dj58n38.</p>\r\n",
          "@type": "http://www.w3.org/2001/XMLSchema#string"
        }
      ],
      "http://purl.org/dc/terms/creator": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/22388"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/22388"
        }
      ],
      "http://purl.org/dc/terms/rights": [
        {
          "@value": "This material is made available to facilitate private study, scholarship, or research. It may be protected by copyright, trademark, privacy, publicity rights, or other interests not owned by UNLV. Users are responsible for determining whether permissions are necessary from rights owners for any intended use and for obtaining all required permissions. Acknowledgement of the UNLV University Libraries is requested. For more information, please see the UNLV Special Collections policies on reproduction and use (https://www.library.unlv.edu/speccol/research_and_services/reproductions) or contact us at [email protected].",
          "@type": "http://www.w3.org/2001/XMLSchema#string"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/12267"
        }
      ],
      "http://purl.org/dc/terms/provenance": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/638"
        }
      ],
      "http://purl.org/dc/terms/date": [
        {
          "@value": "1967",
          "@type": "http://www.w3.org/2001/XMLSchema#string"
        },
        {
          "@value": "1967",
          "@type": "http://www.w3.org/2001/XMLSchema#gYear"
        }
      ],
      "http://purl.org/dc/terms/language": [
        {
          "@value": "en",
          "@type": "http://www.w3.org/2001/XMLSchema#string"
        }
      ],
      "http://purl.org/dc/terms/spatial": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/1010"
        }
      ],
      "http://purl.org/dc/terms/medium": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/114"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/115"
        }
      ],
      "http://purl.org/dc/terms/format": [
        {
          "@value": "image/tiff",
          "@type": "http://www.w3.org/2001/XMLSchema#string",
          "@container": "@list"
        }
      ],
      "http://purl.org/dc/terms/publisher": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/117"
        }
      ],
      "http://purl.org/dc/terms/type": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/107"
        }
      ],
      "http://purl.org/dc/terms/source": [
        {
          "@id": "https://special.library.unlv.edu/node/311097"
        }
      ],
      "http://purl.org/dc/terms/subject": [
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/12271"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/22008"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/155"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/20534"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/647"
        },
        {
          "@id": "https://special.library.unlv.edu/taxonomy/term/20466"
        }
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/node/297751",
      "@type": [
        "http://schema.org/ArchiveComponent",
        "http://schema.org/Collection"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/22388",
      "@type": [
        "http://schema.org/Person"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/638",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/1010",
      "@type": [
        "http://purl.org/dc/terms/Location",
        "http://schema.org/Place"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/114",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/115",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/117",
      "@type": [
        "http://schema.org/Organization"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/107",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/node/311097",
      "@type": [
        "http://schema.org/ArchiveComponent"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/12267",
      "@type": "https://special.library.unlv.edu/rest/type/taxonomy_term/standardized_rights_statement"
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/12271",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/22008",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/155",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/20534",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/647",
      "@type": [
        "http://schema.org/Thing"
      ]
    },
    {
      "@id": "https://special.library.unlv.edu/taxonomy/term/20466",
      "@type": [
        "http://schema.org/Thing"
      ]
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.