141 Matching Annotations
  1. Last 7 days
    1. The Annotations API is an extension to the Europeana REST API which allows you to create, retrieve and manage annotations on Europeana objects. Annotations are user-contributed or system-generated enhancements, additions or corrections to (or a selection of) metadata or media. We adopted the Web Annotation Data Model as a base model for the representation of annotations and as a format for exchanging annotations between client applications and the API, but also the Web Annotation Protocol as base HTTP protocol for the API.

      Example:

      {
        "@context": “http://www.w3.org/ns/anno.jsonld”
        "id": "http://data.europeana.eu/annotations/1",
        "type": "Annotation",
        "created": "2015-03-10T14:08:07Z",
        "creator": {
          "type": "Person",
          "name": "John Smith"
        },
        "generated": "2015-04-01T09:00:00Z",
        "generator": {
            "type": "Software",
            "name": "HistoryPin",
            "homepage": "https://www.historypin.org/"
        },
        "motivation": "tagging",
        "bodyValue": "MyBeautifulTag",
        "target": "http://data.europeana.eu/item/92062/BibliographicResource_1000126189360"
      }
      
  2. Jan 2022
    1. The below illustrates a Dataset Site pointing to feeds consisting of ScheduledSessions, SessionSeries, and Events. As the presence of the webAPI attribute indicates, data items from these feeds are bookable.

      <script type="application/ld+json`/">
      {
         "@context":[
            "https://schema.org/",
            "https://openactive.io/",
            "https://openactive.io/ns-beta"
         ],
         "@type":"Dataset",
         "@id":"https://data.example.com/",
         "name":"Example Sessions and Events",
         "description":"Near real-time availability and rich descriptions relating to sessions and events available from Example.com",
         "url":"https://data.example.com/",
         "dateModified":"2019-08-25T11:23:27+00:00",
         "keywords":[
            "Courses",
            "Sessions",
            "Events",
            "Activities",
            "Sports",
            "Physical Activity",
            "OpenActive"
         ],
         "schemaVersion":"https://www.openactive.io/modelling-opportunity-data/2.0/",
         "license":"https://creativecommons.org/licenses/by/4.0/",
         "publisher":{
            "@type":"Organization",
            "name":"Example.com",
            "description":"Example.com makes it easy to get active!",
            "url":"https://example.com/home",
            "legalName":"Example Ltd",
            "logo":{
               "@type":"ImageObject",
               "url":"https://cdn.example.com/assets/logo.png"
            },
            "email":"support@example.com"
         },
         "discussionUrl":"https://github.com/example/repo/issues",
         "datePublished":"2019-07-11T00:00:00+00:00",
         "inLanguage":[
            "en-GB"
         ],
         "distribution":[
            {
               "@type":"DataDownload",
               "name":"ScheduledSession",
               "additionalType":"https://openactive.io/ScheduledSession",
               "encodingFormat":"application/vnd.openactive.rpde+json; version=1",
               "contentUrl":"https://example.com/api/openactive/scheduledsessions",
               "totalItems": 1852
            },
            {
               "@type":"DataDownload",
               "name":"SessionSeries",
               "additionalType":"https://openactive.io/SessionSeries",
               "encodingFormat":"application/vnd.openactive.rpde+json; version=1",
               "contentUrl":"https://example.com/api/openactive/sessionseries",
               "totalItems": 361
            },
            {
               "@type":"DataDownload",
               "name":"Event",
               "additionalType":"https://schema.org/Event",
               "encodingFormat":"application/vnd.openactive.rpde+json; version=1",
               "contentUrl":"https://example.com/api/openactive/events",
               "totalItems": 1906
            }
         ],
         "backgroundImage":{
            "@type":"ImageObject",
            "url":"https://cdn.example.com/images/background.jpg"
         },
         "documentation":"https://developer.openactive.io/",
         "accessService":{
            "@type":"WebAPI",
            "name":"Open Booking API",
            "description":"The Open Booking API lets you to book OpenActive Opportunities. The API uses standard schema.org types and is compliant with the JSON-LD specification.",
            "documentation":"https://openactive.io/open-booking-api/EditorsDraft",
            "termsOfService":"https://example.com/api/booking/documentation/terms-of-service",
            "provider": {
              "@type": "Organization",
              "name":"examplebooking.com",
              "description":"examplebooking.com makes it easy to get booking!",
              "url":"https://examplebooking.com/home",
              "email":"support@examplebooking.com"
            },
            "endpointUrl":"https://example.com/api/booking/",
            "conformsTo":[
               "https://www.openactive.io/open-booking-api/2.0/"
            ],
            "endpointDescription":"https://www.openactive.io/open-booking-api/2.0/swagger.json",
            "bookingService": {
              "@type": "SoftwareApplication",
              "name": "nyExampleBookingPlatform",
              "softwareVersion": "1.2",
              "url": "https://www.example.com/myExampleBookingPlatform",
              "featureList": "https://www.example.com"
      
      
            }
         }
      }
      </script>
      
  3. Dec 2021
    1. How to get easy-to-read JSON trees with this free Chrome Extension (or Firefox Plugin) Fatos Morina JSON is a very popular file format. Sometimes we may have a JSON object inside a browser tab that we need to read and this can be difficult.We may need to go and search for an online tool that turns it into an easy-to-read format so we can understand it.Now, here is a Chrome and Firefox extension that does the formatting and makes your JSONs instantly pretty inside your browser, without having to perform many unnecessary steps.It comes with support for JSON and JSONP and highlights the syntax so that you can differentiate different attributes and values accordingly. It also comes with the option to collapse nodes, clickable URLs that you can open in new tabs, and you see the raw, unformatted JSON.It works with any JSON page, regardless of the URL you opened. It also works with local files, after you enable it in chrome://extensions. You can inspect the JSON by typing json into the console.You can install the extension by going here for Chrome and here for Firefox and then test it, for example, by visiting this API response.This is what it looks like, before formatting:Now, take a look at the beautiful JSON response you get with JSON Formatter:Here is a pro tip: Hold down CTRL (or CMD on Mac) while collapsing a tree, if you want to collapse all its siblings too.It is an open-source project, so you can view its source code on GitHub.Thanks for reading. Fatos Morina Experienced and passionate Software Engineer, specializing in Machine Learning
      • formatter
    1. WAT Response Format

      WAT files contain important metadata about the records stored in the WARC format above. This metadata is computed for each of the three types of records (metadata, request, and response). If the information crawled is HTML, the computed metadata includes the HTTP headers returned and the links (including the type of link) listed on the page.

      This information is stored as JSON. To keep the file sizes as small as possible, the JSON is stored with all unnecessary whitespace stripped, resulting in a relatively unreadable format for humans. If you want to inspect the JSON file yourself, use one of the many JSON pretty print tools available.

      The HTTP response metadata is most likely to be of interest to CommonCrawl users. The skeleton of the JSON format is outlined below.

          Envelope
              WARC-Header-Metadata
              Payload-Metadata
                  HTTP-Response-Metadata
                      Headers
                          HTML-Metadata
                              Head
                                  Title
                                  Scripts
                                  Metas
                                  Links
                              Links
              Container
      
    1. {
        "@context": {
          "oa": "http://www.w3.org/ns/oa#",
          "dc": "http://purl.org/dc/elements/1.1/",
          "dcterms": "http://purl.org/dc/terms/",
          "dctypes": "http://purl.org/dc/dcmitype/",
          "foaf": "http://xmlns.com/foaf/0.1/",
          "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
          "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
          "skos": "http://www.w3.org/2004/02/skos/core#",
          "text": {
            "@id": "oa:hasBody"
          },
          "target": {
            "@type": "@id",
            "@id": "oa:hasTarget"
          },
          "source": {
            "@type": "@id",
            "@id": "oa:hasSource"
          },
          "selector": {
            "@type": "@id",
            "@id": "oa:hasSelector"
          },
          "state": {
            "@type": "@id",
            "@id": "oa:hasState"
          },
          "scope": {
            "@type": "@id",
            "@id": "oa:hasScope"
          },
          "user": {
            "@type": "@id",
            "@id": "oa:annotatedBy"
          },
          "serializedBy": {
            "@type": "@id",
            "@id": "oa:serializedBy"
          },
          "motivation": {
            "@type": "@id",
            "@id": "oa:motivatedBy"
          },
          "stylesheet": {
            "@type": "@id",
            "@id": "oa:styledBy"
          },
          "cached": {
            "@type": "@id",
            "@id": "oa:cachedSource"
          },
          "conformsTo": {
            "@type": "@id",
            "@id": "dcterms:conformsTo"
          },
          "members": {
            "@type": "@id",
            "@id": "oa:membershipList",
            "@container": "@list"
          },
          "item": {
            "@type": "@id",
            "@id": "oa:item"
          },
          "related": {
            "@type": "@id",
            "@id": "skos:related"
          },
          "format": "dc:format",
          "language": "dc:language",
          "created": "oa:annotatedAt",
          "updated": "oa:serializedAt",
          "when": "oa:when",
          "value": "rdf:value",
          "start": "oa:start",
          "end": "oa:end",
          "exact": "oa:exact",
          "prefix": "oa:prefix",
          "suffix": "oa:suffix",
          "label": "rdfs:label",
          "name": "foaf:name",
          "mbox": "foaf:mbox",
          "nick": "foaf:nick",
          "styleClass": "oa:styleClass",
          "@base": "http://hypothes.is/api/annotations/",
          "id": "@id",
          "tags": "oa:Tag"
        },
        "updated": "2014-09-18T21:43:16.353744+00:00",
        "target": [
          {
            "source": "http://faculty.georgetown.edu/irvinem/theory/Berners-Lee-HTTP-proposal.pdf",
            "pos": {
              "top": 549.5,
              "height": 17
            },
            "selector": [
              {
                "type": "RangeSelector",
                "startContainer": "/div[1]/div[2]/div[4]/div[1]/div[1]/div[2]/div[16]",
                "endContainer": "/div[1]/div[2]/div[4]/div[1]/div[1]/div[2]/div[16]",
                "startOffset": 0,
                "endOffset": 7
              },
              {
                "start": 397,
                "end": 404,
                "type": "TextPositionSelector"
              },
              {
                "type": "TextQuoteSelector",
                "prefix": "information Hypermedia CERNDOC",
                "exact": "ENQUIRE",
                "suffix": "Tim Berners-Lee section group C"
              }
            ]
          }
        ],
        "created": "2014-09-18T21:32:13.492351+00:00",
        "text": "As featured in \"Weaving the Web\" by Tim Berners-Lee",
        "tags": [
          "web",
          "history"
        ],
        "uri": "http://faculty.georgetown.edu/irvinem/theory/Berners-Lee-HTTP-proposal.pdf",
        "user": "acct:BigBlueHat@hypothes.is",
        "document": {
          "eprints": {},
          "title": "Berners-Lee-HTTP-proposal.pdf",
          "twitter": {},
          "dc": {},
          "prism": {},
          "highwire": {},
          "facebook": {},
          "reply_to": [],
          "link": [
            {
              "href": "http://faculty.georgetown.edu/irvinem/theory/Berners-Lee-HTTP-proposal.pdf"
            }
          ]
        },
        "consumer": "00000000-0000-0000-0000-000000000000",
        "id": "Gk_TW9d_SyCG5cFH4UCy9A",
        "permissions": {
          "admin": [
            "acct:BigBlueHat@hypothes.is"
          ],
          "read": [
            "acct:BigBlueHat@hypothes.is",
            "group:__world__"
          ],
          "update": [
            "acct:BigBlueHat@hypothes.is"
          ],
          "delete": [
            "acct:BigBlueHat@hypothes.is"
          ]
        }
      }
      
    1. Transparent data access

      JavaScript Proxies enable LDflex processors to translate path expressions to SPARQL queries and resolve them through a query engine (e.g. Comunica)

      await [https://julianrojas.org/#me].name
      
      SELECT ?name WHERE {
        <https://julianrojas.org/#me> <http://xmlns.com/foaf/0.1/name> ?name.
      }
      
    2. Support for data writing

      LDflex allows for writing/updating knowledge graphs that support SPARQL UPDATE operations such as SPARQL endpoints and Solid pods.

      For example this expression:

      await [https://julianrojas.solid.org/profile/#me].add('foaf:givenName' , 'Julian');
      

      Will be translated to this SPARQL UPDATE query:

      INSERT DATA {
        <https://julianrojas.solid.org/profile/#me> 
          <http://xmlns.com/foaf/0.1/givenName> "Julian".
      }
      
    3. How does it work? Thanks to JSON-LD contexts and JavaScript Proxies we can treat Linked Data graphs as local objects The await keyword allows waiting for remote HTTP requests
    4. Traverse Linked Data as JS objects

      await [https://julianrojas.org/#me].name // "Julián Rojas"
      await [https://julianrojas.org/#me].friends.name // ["Ruben Verborgh", "Ruben Taelman", ...]
      
    1. upload edited CSV and convert back to JSON

      permite editar y volver a generar el JSON!

  4. Nov 2021
    1. import { createRequire } from "module"; const require = createRequire(import.meta.url); const data = require("./data.json");
  5. Oct 2021
  6. Sep 2021
    1. Thanks to Rack Middleware and Rails 3 you can output pretty JSON for every request without changing any controller of your app. I have written such middleware snippet and I get nicely printed JSON in browser and curl output.
  7. Jul 2021
  8. Jun 2021
  9. komkom.github.io komkom.github.io
    1. Jsonc is a simplified json format which allows comments and unquoted values delimited by whitespace. A jsonc formatted file can be transformed to a json file. Comments will be stripped out and quotes added.

      Good definition of jsonc file.

    1. You can use jsonb_agg and jsonb_array_elements_text to flatten or unnest an array of arrays in PostgreSQL: SELECT jsonb_array_elements_text(jsonb_agg(array_of_arrays)) FROM x;
    1. And this has some immediate benefits: more efficiency, significantly faster to process, supports indexing (which can be a significant advantage, as we'll see later), simpler schema designs (replacing entity-attribute-value (EAV) tables with jsonb columns, which can be queried, indexed and joined, allowing for performance improvements up until 1000X!)
    2. Besides efficiency, there are extra ways in which you can benefit from storing JSON in binary form. One such enhancement is the GIN (Generalized Inverted Index) indexes and a new brand of operators that come with them.
    3. SELECT jsonb_array_elements_text(data->'genres') AS genre FROM books WHERE book_id = 1; That will expand the JSON array into a column:
    4. This is an important one, as it will enable us to use the aggregate functions that we are familiar when dealing with relational databases, but in the otherwise counter-intuitive environment of JSON data.
    1. As stated in the title, I am in a situation where I need to return a count of occurrences within an array, that is within a jsonb column.
    1. select t.* from my_table t, jsonb_each(my_col) as value1(key1, value1), jsonb_each(value1) as value2(key2, value2) where jsonb_typeof(my_col) = 'object' and jsonb_typeof(value1) = 'object' and value2->>'Param3' = '6';
    1. json_array_elements_text ( json ) → setof text jsonb_array_elements_text ( jsonb ) → setof text Expands the top-level JSON array into a set of text values. select * from json_array_elements_text('["foo", "bar"]') → value ----------- foo bar
  10. May 2021
  11. Feb 2021
    1. {'good': ['API objects', 'structured data', 'data sources', 'filtering and operations'],'improvement areas for v2': ['AWS deployment images too small', 'not setting up the data sources in aws that it talked up','not enough numpy','no deep learning yo','drop or shorten up the kitchen analogy, we get what distributed computing is'],'realization: "out of the box functionality won't be much help for real life... have to get weird w delayed objects"}
    1. Although XML has become a lingua franca for publishing and data interchange, its usage has decreased among information technology professionals, who now tend to prefer JSON for data interchange, especially in situations where the data structure is straightforward.
  12. Dec 2020
  13. Nov 2020
    1. Conclusions Draw your own. No? Fine. Good Enough: JSON? Protobuf Cap’n Proto Flatbuffers CBOR msgpack Avoid: YAML XML Thrift? BSON

      Alternatives to JSON which are well readable by humans. In short, JSON is still fine and seems like it will be for a long time

  14. Oct 2020
    1. Over the years, Google has gone from recommending uploading a text file, to parsing RDFa with a slightly modified Microformats vocabulary, to going all-in on Microdata, to then replacing Microdata with JSON-LD and the new Schema.org vocabulary. In the mean time, the Microformats hReview vocabulary hasn't changed, and has continued to be parsed by Google since it is so widely deployed. It would seem there is some advantage to using a format that was developed externally from Google, since they are unable to simply turn their backs on it and replace it with a new format whenever they want. For this reason, I'm sticking with publishing the Microformats 1 hReview markup for my reviews.
  15. Jul 2020
    1. Listens to changes in a PostgreSQL Database and broadcasts them over WebSocket. It works like this:the Phoenix server listens to PostgreSQL's replication functionality (using Postgres' logical decoding).it converts the byte stream into JSON.it then broadcasts over WebSocket.
    1. JSON parsing is always pain in ass. If the input is not as expected it throws an error and crashes what you are doing. You can use the following tiny function to safely parse your input. It always turns an object even if the input is not valid or is already an object which is better for most cases.

      It would be nicer if the parse method provided an option to do it safely and always fall back to returning an object instead of raising exception if it couldn't parse the input.

  16. May 2020
    1. I'll change at some point the format of the JSON so that the link can also be directly stored. That way it would be mandatory/useful to provide it with the JSON.
  17. Apr 2020
    1. JSON-RPC is “level 0” of the Richardson Maturity Model – a model that describes the qualities of a REST design.

      JSON-RPC.

      You can build it by:

      • using HTTP VERBs correctly
      • organising your APIs into logical "resources", e.g. ("customer", "product", "catalogue")
      • using correct HTTP response codes for interactions with your API
    2. there was a push for standardisation of “SOAP” (simple object access protocol) APIs

      Standarisation of SOAP brought a lot of good stuff but people found XML cumbersome to read.

      A lot of things being solved in SOAP had to subsequently be re-solved on top of JSON using emerging open-ish standards like Swagger (now OpenAPI) and JSON:API

    3. Most APIs you use, or build will be “REST-ish”.
      • You'll be issuing the same kind of "HTTP requests" as the browser
      • Mostly you'll get JSON responses (sometimes XML)
      • You can describe these APIs as JSON-RPC or XML-RPC
    1. Square brackets hold arrays and values are separated by ,(comma).

      Test question: What are square brackets used for?

    2. JSON syntax is basically considered as a subset of JavaScript syntax;

      Test question: What is JSON syntax part of?

    3. name/value pairs.

      Test question: How is the data in json represented?

    1. As you can see the CSV parser is 20x faster and performs 75% fewer allocations.

      csv vs json. CSV is way easier to process.

  18. Mar 2020
    1. in XML the ordering of elements is significant. Whereas in JSON the ordering of the key-value pairs inside objects is meaningless and undefined

      XML vs JSON (ordering elements)

    2. XML is a document markup language; JSON is a structured data format, and to compare the two is to compare apples and oranges

      XML vs JSON

    1. A particular strength of JSON is its support for nested data structures

      JSON can facilitate arrays, such as:

      "favorite_movies": [ "Diehard", "Shrek" ]
      
    2. JSON’s origins as a subset of JavaScript can be seen with how easily it represents key/value object data. XML, on the other hand, optimizes for document tree structures, by cleanly separating node data (attributes) from child data (elements)

      JSON for key/value object data

      XML for document tree structures (clearly separating node data (attributes) from child data (elements))

    3. The advantages of XML over JSON for trees becomes more pronounced when we introduce different node types. Assume we wanted to introduce departments into the org chart above. In XML, we can just use an element with a new tag name
    4. JSON is well-suited for representing lists of objects with complex properties. JSON’s key/value object syntax makes it easy. By contrast, XML’s attribute syntax only works for simple data types. Using child elements to represent complex properties can lead to inconsistencies or unnecessary verbosity.

      JSON works well for list of objects with complex properties. XML not so much

  19. Sep 2019
    1. A utility function to safely escape JSON for embedding in a <script> tag function safeStringify(obj)
  20. Oct 2018
    1. Components.js is a dependency injection framework for JavaScript applications. Instead of hard-wiring software components together, Components.js allows these components to be instantiated and wired together declaratively using semantic configuration files. The advantage of these semantic configuration files is that software components can be uniquely and globally identified using URIs. Configurations can be written in any RDF serialization, such as JSON-LD. This software is aimed for developers who want to build modular and easily configurable and rewireable JavaScript applications.
    1. If you want to make the Semantic Web a reality, stop making the case for it and spend your time doing something more useful, like actually making machines smarter or helping people publish data in a way that’s useful to them.

      Soooo true !

  21. Sep 2018
    1. RDF Translator is a multi-format conversion tool for structured markup. It provides translations between data formats ranging from RDF/XML to RDFa or Microdata. The service allows for conversions triggered either by URI or by direct text input. Furthermore it comes with a straightforward REST API for developers.
    1. 1 down vote unaccept It's necessary that the term match the IRI you use for the property. For example, schema.org defines name as http://schema.org/name. In your example, you have http://www.schema.org/name. There are also several places where values which should be IRIs (URLs) are treated as text, for this you want to use something like "http://schema.org/image": {"@id": "/static/track_images_200/lr1734_2009720_1372375126.jpg"} Part of term selection looks to be sure that a value matches the appropriate @type definition within the context. For example, image is set to {"@type": "@id"}, so it will only match things that look like that.
    1. { "@context": "https://schema.org/docs/jsonldcontext.json", "@type": ["Article", "NewsArticle", "TechArticle", "ScholarlyArticle"], "author": { "@embed": "@always" }, "creator": { "@embed": "@always" } }
    1. <script type="application/ld+json"> { "@context": "http://schema.org", "@type" : "WebPage", "name" : "The Name of the Webpage", "author" : { "@type" : "Person", "@id": "#tim", "name" : "Tim" }, "creator": { "@id": "#tim" }, "copyrightHolder": { "@id": "#tim" } } </script>
    1. Pitfalls of Framed JSON-LD The choice to provide framed JSON-LD does have some downsides, though. Any entity within the graph that is repeated is only fully referenced in the flattened, framed JSON-LD. This behavior is most evident when viewing an autobiographic work, such as "The autobiography of Benjamin Franklin, 1706-1757". In the example below, you can see that the entity representing Benjamin Franklin is both a schema:creator and a schema:about. However, Benjamin Franklin’s full details only appear in one place in the framed JSON-LD. This is problematic for someone using the data in an object-oriented manner rather than treating it as a graph.
    1. DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG
    1. A JSON-LD document is a representation of a directed graph. A single directed graph can have many different serializations, each expressing exactly the same information. Developers typically work with trees, represented as JSON objects. While mapping a graph to a tree can be done, the layout of the end result must be specified in advance. A Frame can be used by a developer on a JSON-LD document to specify a deterministic layout for a graph.
    1. <link rel="alternate" href="manifest.json" media-type="application/webpub+json"/>
  22. Mar 2018
    1. not everything needs to be gradually extended into six mutually incompatible versions of increasing bloat

  23. Dec 2017
  24. Nov 2017
    1. xAPI is a json based data structure that's for expressing the actions taken by a user. It's popular for tracking activity across websites because of it having a standard base schema with flexibility for providing contextual information based on use-case.
  25. Apr 2017
    1. JSON API requires use of the JSON API media type (application/vnd.api+json) for exchanging data.

      means to change the Accept field and Content-Type field

  26. Feb 2017