56 Matching Annotations
  1. Sep 2019
    1. A utility function to safely escape JSON for embedding in a <script> tag function safeStringify(obj)
  2. 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 !

  3. 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"/>
  4. Mar 2018
    1. not everything needs to be gradually extended into six mutually incompatible versions of increasing bloat

  5. Jan 2018
    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.
  6. Dec 2017
  7. 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.
  8. 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

  9. Feb 2017
  10. 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

  11. Nov 2016
    1. Services rely on the interfaces between them to communicate and for this to work flawlessly, messages must have a format and semantics that every interface can read.

      This makes JSON-LD (JSON for Linking Data http://json-ld.org/) and Hydra (A Vocabulary for Hypermedia-Driven Web APIs) interesting, see http://www.programmableweb.com/news/how-to-build-hypermedia-apis-json-ld-and-hydra/analysis/2015/07/30

  12. Jun 2016
  13. Nov 2015
  14. Mar 2015
  15. Feb 2015