8,037 Matching Annotations
  1. Feb 2023
  2. Jan 2023
    1. Annotating an in-text reference pointer with a citation function

      ```turtle @prefix : http://www.sparontologies.net/example/ . @prefix cito: http://purl.org/spar/cito/ . @prefix c4o: http://purl.org/spar/c4o/ . @prefix oa: http://www.w3.org/ns/oa# . @prefix per: http://data.semanticweb.org/person/ .

      :annotation a oa:Annotation ; oa:hasBody :citation ; oa:hasTarget :in-text-ref-pointer ; oa:annotatedBy per:silvio-peroni .

      :citation a cito:Citation; cito:hasCitingEntity :paper-a ; cito:hasCitationEvent cito:extends ; cito:hasCitedEntity :paper-b .

      :in-text-ref-pointer a c4o:InTextReferencePointer ; c4o:hasContent "[6]" . ```

    2. Annotating a citation with an additional text-defined citation function

      ```turtle @prefix : http://www.sparontologies.net/example/ . @prefix cito: http://purl.org/spar/cito . @prefix cnt: http://www.w3.org/2011/content# . @prefix oa: http://www.w3.org/ns/oa# .

      :annotation a oa:Annotation; oa:motivatedBy oa:commenting ; oa:hasBody :comment ; oa:hasTarget :citation .

      :comment a cnt:ContentAsText ; cnt:chars "I'm citing that paper because it initiated this whole new field of research." .

      :citation a cito:Citation; cito:hasCitingEntity :paper-a ; cito:hasCitationCharacterization cito:cites ; cito:hasCitedEntity :paper-b . ```

    1. The code above is somewhat simplified and missing some checks that I would advise implementing in a serious production application. For example:The request contains a Date header. Compare it with current date and time within a reasonable time window to prevent replay attacks.It is advisable that requests with payloads in the body also send a Digest header, and that header be signed along in the signature. If it’s present, it should be checked as another special case within the comparison string: Instead of taking the digest value from the received header, recompute it from the received body.While this proves the request comes from an actor, what if the payload contains an attribution to someone else? In reality you’d want to check that both are the same, otherwise one actor could forge messages from other people.
    2. We need to read the Signature header, split it into its parts (keyId, headers and signature), fetch the public key linked from keyId, create a comparison string from the plaintext headers we got in the same order as was given in the signature header, and then verify that string using the public key and the original signature.

      ```ruby require 'json' require 'http'

      post '/inbox' do signature_header = request.headers['Signature'].split(',').map do |pair| pair.split('=').map do |value| value.gsub(/\A"/, '').gsub(/"\z/, '') # "foo" -> foo end end.to_h

      key_id = signature_header['keyId'] headers = signature_header['headers'] signature = Base64.decode64(signature_header['signature'])

      actor = JSON.parse(HTTP.get(key_id).to_s) key = OpenSSL::PKey::RSA.new(actor['publicKey']['publicKeyPem'])

      comparison_string = headers.split(' ').map do |signed_header_name| if signed_header_name == '(request-target)' '(request-target): post /inbox' else "#{signed_header_name}: #{request.headers[signed_header_name.capitalize]}" end end

      if key.verify(OpenSSL::Digest::SHA256.new, signature, comparison_string) request.body.rewind INBOX << request.body.read [200, 'OK'] else [401, 'Request signature could not be verified'] end end ```

    1. Appendix I - Categories

      • anthropology
      • astronomy
      • biology
      • botany
      • chemistry
      • communications
      • engineering
      • generic-base - used for generic styles like Harvard and APA
      • geography
      • geology
      • history
      • humanities
      • law
      • linguistics
      • literature
      • math
      • medicine
      • philosophy
      • physics
      • political_science
      • psychology
      • science
      • social_science
      • sociology
      • theology
      • zoology
    1. The URN “urn:iso:std:iso:19719:ed-1:v1:en,fr” denotes the first version of the first edition of ISO 19719, which is published bilingually in English and French.
    1. ```js const TOKEN = "YOUR_PERSONAL_ACCESS_TOKEN"; const GIST_ID = "YOUR_GIST_ID"; const GIST_FILENAME = "db.json";

      / * Reads the JSON file inside of the gist / async function getData() { const req = await fetch(https://api.github.com/gists/${GIST_ID}); const gist = await req.json(); return JSON.parse(gist.files[GIST_FILENAME].content); }

      / * Puts the data you want to store back into the gist / async function setData(data) { const req = await fetch(https://api.github.com/gists/${GIST_ID}, { method: "PATCH", headers: { Authorization: Bearer ${TOKEN}, }, body: JSON.stringify({ files: { [GIST_FILENAME]: { content: JSON.stringify(data), }, }, }), });

      return req.json(); } ```

    1. @tomcritchlow

      Have you seen the OPDS Catalog 1.2 (ATOM over HTTP with OpenSearch) and the OPDS Catalog 2.0 (JSON-LD over HTTP) protocols ?

      OPDS define a bookshelf-like access to books repositories and can be used with eBooks readers to retrieve ePub books.

      The French National Library, The Gutenberg Project, The Internet Archive or Gallimard (a French editor) provide an OPDS feed.

    1. json { "@context": { "@vocab": "https://schema.org/", "endDate": { "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "startDate": { "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } }, "@id": "https://example.org/id/course/2", "@type": "Course", "courseCode": "SD100", "name": "Structured Data", "description": "An introduction to authoring JSON-LD documents for OIH", "teaches": "JSON-LD", "provider": { "@type": "Organization", "name": "Example University", "@id": "https://grid.ac/institutes/grid.475727.4", "description": "UN Department of Economic and Social Affairs Sustainable Development" }, "hasCourseInstance": [{ "@type": "CourseInstance", "courseMode": ["MOOC1", "online"], "endDate": "2019-03-21", "startDate": "2019-02-15", "attendee": { "@type": "Person", "name": "Jane Doe", "jobTitle": "Professor", "telephone": "(425) 123-4567", "url": "http://www.janedoe.com", "identifier": { "@id": "ID_value_string", "@type": "PropertyValue", "propertyID": "This can be text or URL for an ID like ORCID", "url": "https://foo.org/linkToPropertyIDPage", "description": "Optional description of the ID" } } }, { "@type": "CourseInstance", "courseMode": ["MOOC2", "online"], "endDate": "2019-05-21", "startDate": "2019-04-15" }] }

    1. console $ curl -LH "Accept: application/vnd.schemaorg.ld+json" https://doi.org/10.5438/4K3M-NYVG { "@context": "http://schema.org", "@type": "ScholarlyArticle", "@id": "https://doi.org/10.5438/4k3m-nyvg", "url": "https://blog.datacite.org/eating-your-own-dog-food/", "additionalType": "BlogPosting", "name": "Eating your own Dog Food", "author": { "name": "Martin Fenner", "givenName": "Martin", "familyName": "Fenner", "@id": "https://orcid.org/0000-0003-1419-2405" }, "description": "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...", "license": "https://creativecommons.org/licenses/by/4.0/legalcode", "version": "1.0", "keywords": "datacite, doi, metadata, FOS: Computer and information sciences", "inLanguage": "en", "dateCreated": "2016-12-20", "datePublished": "2016-12-20", "dateModified": "2016-12-20", "isPartOf": { "@id": "https://doi.org/10.5438/0000-00ss", "@type": "CreativeWork" }, "citation": [ { "@id": "https://doi.org/10.5438/0012", "@type": "CreativeWork" }, { "@id": "https://doi.org/10.5438/55e5-t5c0", "@type": "CreativeWork" } ], "schemaVersion": "http://datacite.org/schema/kernel-4", "periodical": { "@type": "Series", "identifier": "10.5438/0000-00SS", "identifierType": "DOI" }, "publisher": { "@type": "Organization", "name": "DataCite" }, "provider": { "@type": "Organization", "name": "datacite" } }