350 Matching Annotations
  1. Apr 2022
    1. In the previous version, using the standard library, once the data is loaded we no longer to keep the file open. With this API the file has to stay open because the JSON parser is reading from the file on demand, as we iterate over the records.

      For ijson.items(), the peak tracked memory usage was 3.6 MiB for a large JSON, instead of 124.7 MiB as for the standard json.load()

  2. Mar 2022
  3. Feb 2022
  4. Jan 2022
    1. An extension to python markdown that takes metadata embedded as YAML in a page of markdown and render it as JSON-LD in the HTML created by MkDocs.
      • YAML input

        "@context": "http://schema.org"
        "@id": "#lesson1"
        "@type":
          - CreativeWork
        learningResourceType: LessonPlan
        hasPart: {
        "@id": "#activity1"
        }
        author:
          "@type": Person
          name: Phil Barker
        
      • Default JSON-LD output

        <script type="application/ld+json">
        { "@context":  "http://schema.org",
        "@id": "#lesson1",
        "@type":["CreativeWork"],
        "learningResourceType": "LessonPlan",
        "name": "Practice Counting Strategies",
        "hasPart": {
          "@id": "#activity1-1"
        }
        "author": {
          "@type": "Person"
          "name": "Phil Barker"
        }
        }
        </script>
        
    1. The metadata that we use for OCX is a profile of schema.org / LRMI,  OERSchema and few bits that we have added because we couldn’t find them elsewhere. Here’s what (mostly) schema.org metadata looks like in YAML:
      "@context":
          - "http://schema.org"
          - "oer": "http://oerschema.org/"
          - "ocx": "https://github.com/K12OCX/k12ocx-specs/"
      "@id": "#Lesson1"
      "@type":
          - oer:Lesson
          - CreativeWork
      learningResourceType: LessonPlan
      hasPart:
        "@id": "#activity1-1"
      author:
          "@type": Person
          name: Phil Barker
      
    1. HyperGraphQL is a GraphQL interface for querying and serving linked data on the Web. It is designed to support federated querying and exposing data from multiple linked data services using GraphQL query language and schemas. The basic response format is JSON-LD, which extends the standard JSON with the JSON-LD context enabling semantic disambiguation of the contained data.
    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"
      }
      
    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>
      
  5. 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"
          ]
        }
      }
      
  6. Nov 2021
  7. Oct 2021
  8. Sep 2021
  9. Jul 2021
  10. Jun 2021
  11. 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.

  12. May 2021
  13. 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.
  14. Dec 2020
  15. 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

  16. 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.
  17. 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.

  18. May 2020
  19. 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

  20. Mar 2020
    1. 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))

    2. 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
    3. 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

  21. Sep 2019
  22. 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 !

  23. 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. 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.
  24. Mar 2018
  25. Dec 2017
  26. Nov 2017
  27. Apr 2017
  28. Feb 2017
  29. Dec 2016
    1. The real benefit of JSONB: IndexesWe want our application to be fast. Without indexes, the database is forced to go from record to record (a table scan), checking to see if a condition is true. It’s no different with JSON data. In fact, it’s most likely worse since Postgres has to step in to each JSON document as well.

      This solves the problem of the last implementation I handled where json (not jsonb) data was stored in postgres

    1. When you’re picking a data store, the most important thing to understand is where in your data — and where in its connections — the business value lies. If you don’t know yet, which is perfectly reasonable, then choose something that won’t paint you into a corner. Pushing arbitrary JSON into your database sounds flexible, but true flexibility is easily adding the features your business needs.

      This is an old article but valuable thinking for system design.

    1. The BSON format used by MongoDB is limited to a maximum of 64 bits for representing an integer or floating point number, whereas the JSONB format used by Postgres does not have this limit. Postgres provides data constraint and validation functions to help ensure that JSON documents are more meaningful: for example, preventing attempts to store alphabetical characters where numerical values are expected. MongoDB offers automatic database sharding for easy horizontal scaling of JSON data storage. Scaling of Postgres installations has often been vertical. Horizontal scaling of Postgres is also possible, but tends to be more involved or use an additional third party solution. MongoDB also offers the possibility of increasing write throughput by deferring writing to disk. The tradeoff is potential loss of data, but this may suit users who have less need to persist their data.

      Good pros and cons of Mongo vs Postgres for JsonB

  30. Nov 2016
  31. Jun 2016
  32. Nov 2015
  33. Mar 2015
  34. Feb 2015