243 Matching Annotations
  1. Last 7 days
  2. Nov 2022
    1. The @id keyword allows you to give a node a URI. This URI identifies the node. See Node Identifiers in the JSON-LD spec. (The equivalent in Microdata is the itemid attribute, and the equivalent in RDFa Lite is the resource attribute.)
  3. Oct 2022
  4. Sep 2022
    1. pointer: type: string description: A string containing a JSON pointer to the specific field within a received JSON body that caused the problem, e.g. '/data/attributes/title' to refer to the `title` property within the `attributes` object that is a child of the top level `data` object. example: /data/attributes/title
    1. A workaround you can use is to move additionalProperties to the extending schema and redeclare the properties from the extended schema.
    2. Because additionalProperties only recognizes properties declared in the same subschema, it considers anything other than “street_address”, “city”, and “state” to be additional. Combining the schemas with allOf doesn’t change that.
    3. It’s important to note that additionalProperties only recognizes properties declared in the same subschema as itself. So, additionalProperties can restrict you from “extending” a schema using Schema Composition keywords such as allOf. In the following example, we can see how the additionalProperties can cause attempts to extend the address schema example to fail.
    1. In your scenario, which many, many people encounter, you expect that properties defined in schema1 will be known to schema2; but this is not the case and will never be.
    2. When you do: "allOf": [ { "schema1": "here" }, { "schema2": "here" } ] schema1 and schema2 have no knowledge of one another; they are evaluated in their own context.
    3. I'm not sure if there's a reason why additionalProperties only looks at the sibling-level when checking allowed properties but IMHO this should be changed.
    4. It's unfortunate that additionalProperties only takes the immediate, sibling-level properties into account
    5. additionalProperties applies to all properties that are not accounted-for by properties or patternProperties in the immediate schema.

      annotation meta: may need new tag: applies to siblings only or applies to same level only

    6. additionalProperties here applies to all properties, because there is no sibling-level properties entry - the one inside allOf does not count.
    7. You have stumbled upon the most common problem in JSON Schema, that is, its fundamental inability to do inheritance as users expect; but at the same time it is one of its core features.
    1. unevaluatedProperties is like additionalProperties, except that it can "see through" $ref and "see inside" allOf, anyOf, oneOf, if, then, else
    2. I think the answer lies here: Cant see into oneOf or allOf etc. This, I think, is the distinguishing difference between additionalProperties and unevaluatedProperties.
    3. However, unevaluatedProperties has dynamic behavior, meaning that the set of properties to which it applies cannot be determined from static analysis of the schema (either the immediate schema object or any subschemas of that object).

      annotation meta: may need new tag:

      dynamic behavior vs. static analysis [not quite parallel]

      or can we reuse something else like?: lexical semantics vs. run-time semantics

    4. unevaluatedProperties is similar to additionalProperties in that it has a single subschema, and it applies that subschema to instance properties that are not a member of some set.
    1. The latest (draft 2020-12) version of JSON Schema supports the unevaluatedProperties vocabulary (see here). This is quite a useful feature, and facilitates stricter validation while composing properties from multiple sub-schemas (using e.g. allOf) than would otherwise possible.
    2. OAS 3.1 uses all of JSON Schema draft 2020-12 including unevaluatedProperties. You won't find direct references to unevealuatedProperties in the OAS spec because it links to the JSON Schema spec instead of duplicating it's contents.
    1. JSON Schema allows for additionalProperties both a boolean or an object value. true is interpreted as "additional properties follow no restrictions", false means "no additional restrictions", and an object is interpreted as a JSON schema applied to the property values (the empty object is thus equivalent to true).
  5. Aug 2022
    1. 05:03 Linking Zotero to Obsidian

      https://www.youtube.com/watch?v=D9ivU_IKO6M Zotero管理论文的,不知道网页文章能否,如果可以,那么通过notion自制的信息管理系统就像是重复造轮子。看来我一直在重复重复造轮子···唉,metadata自动生成的json文件与ob进行一种链接。

  6. Jul 2022
    1. When you see a job post mentioning REST or a company discussing REST Guidelines they will rarely mention either hypertext or hypermedia: they will instead mention JSON, GraphQL(!) and the like.
  7. Jun 2022
    1. The creator of GraphQL admits this. During his presentation on the library at a Facebook internal conference, an audience member asked him about the difference between GraphQL and SOAP. His response: SOAP requires XML. GraphQL defaults to JSON—though you can use XML.
    2. Conclusion There are decades of history and a broad cast of characters behind the web requests you know and love—as well as the ones that you might have never heard of. Information first traveled across the internet in 1969, followed by a lot of research in the ’70s, then private networks in the ’80s, then public networks in the ’90s. We got CORBA in 1991, followed by SOAP in 1999, followed by REST around 2003. GraphQL reimagined SOAP, but with JSON, around 2015. This all sounds like a history class fact sheet, but it’s valuable context for building our own web apps.
  8. May 2022
    1. json { "success": true, "message": "User logged in successfully", "data": { "user": { "id": 2, "name": "Client", "client_id": 1, "email": "client@clickapps.co", "gender_label": null, "gender": null, "mobile": "123654789", "code_country": "00967", "birth_date": null, "avatar": "http://localhost:3000/default_image.png", "sms_notification": true, "is_mobile_verified": false, "otp": { "otp": "8704" }, "client_city": { "id": 3, "name_ar": "الرياض", "name_en": "Riadh", "name": "Riadh", "status": 1, "status_label": "Active", "country": { "id": 2, "name": "Kingdub saudi Arab", "code_country": "ksa", "avatar": "http://localhost:3000/default_image.png", "status": 1, "status_label": "Active" } }, "client_locations": [ { "id": 1, "client_id": 1, "latitude": "0.0", "longitude": "0.0", "address": "169 Rath Rapids", "address_ar": "964 Michale Parkway", "address_en": "169 Rath Rapids", "building_name": "building_name", "location_type": 1, "location_type_label": "Home", "apartment_name": null, "require_permission": false, "city": null, "zip_code": null } ] }, "role": "client", "token": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MiwibmFtZSI6IkNsaWVudCIsImVtYWlsIjoiY2xpZW50QGNsaWNrYXBwcy5jbyIsIm1vYmlsZSI6IjEyMzY1NDc4OSIsImltYWdlIjoiL2RlZmF1bHRfaW1hZ2UucG5nIiwiYWRtaW4iOmZhbHNlLCJpYXQiOjE1NDc5MjU0MzIsImV4cCI6MTU1MDUxNzQzMn0.4Vyjd7BG7v8AFSmGKmIs4VM2FBw3gOLn97Qdf6U4jxU" } }

    1. ``` HTTP/1.1 200 OK Content-Type: application/ld+json Link: http://api.example.com/doc/; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"

      { "@context": "http://www.w3.org/ns/hydra/context.jsonld", "@graph": [{ "@id": "http://api.example.com/people", "@type": "hydra:Collection", "api:personByName": "api:PersonByNameTemplate" }, { "@id": "http://api.example.com/events", "@type": "hydra:Collection", "api:eventByName": "api:EventByNameTemplate" } } ```

    1. The GS1 Web Vocabulary collects terms defined in various GS1 standards and data systems and made available for general use following Linked Data principles. It is designed as an extension to schema.org and, where relevant, mappings and relationships arising from that vocabulary are made explicit. The initial focus of the GS1 Web Vocabulary is consumer-facing properties for clothing, shoes, food beverage/tobacco and properties common to all products.
    1. ```html

      <script type="application/ld+json"> { "@context": "https://schema.org", "@type": ["MathSolver", "LearningResource"], "name": "An awesome math solver", "url": "https://www.mathdomain.com/", "usageInfo": "https://www.mathdomain.com/privacy", "inLanguage": "en", "potentialAction": [{ "@type": "SolveMathAction", "target": "https://mathdomain.com/solve?q={math_expression_string}", "mathExpression-input": "required name=math_expression_string", "eduQuestionType": ["Polynomial Equation","Derivative"] }], "learningResourceType": "Math solver" }, { "@context": "https://schema.org", "@type": ["MathSolver", "LearningResource"], "name": "Un solucionador de matemáticas increíble", "url": "https://es.mathdomain.com/", "usageInfo": "https://es.mathdomain.com/privacy", "inLanguage": "es", "potentialAction": [{ "@type": "SolveMathAction", "target": "https://es.mathdomain.com/solve?q={math_expression_string}", "mathExpression-input": "required name=math_expression_string", "eduQuestionType": ["Polynomial Equation","Derivative"] }], "learningResourceType": "Math solver" } </script>

      ```

  9. 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. One common solution is streaming parsing, aka lazy parsing, iterative parsing, or chunked processing.

      Solution for processing large JSON files in Python

  10. Mar 2022
  11. Feb 2022
  12. 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
      
    2. I’ve been experimenting with ways of putting JSON-LD schema.org metadata into HTML created by MkDocs. The result is a python-markdown plugin that will (hopefully) find blocks of YAML in markdown and insert then into the HTML that is generated.
    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. {
       "@context": {
        "doap": "http://usefulinc.com/ns/doap#",
        "url": "@id",
        "name": "doap:name",
        "description": "doap:description",
        "author": "doap:maintainter",
        "license": "doap:license", // can we map values to https://spdx.org/licenses/ ?
        ...
        },
        "homepage": {"@id": "doap:homepage", "@type": "@id"}
      }
      
    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>
      
  13. 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!

  14. Nov 2021
    1. import { createRequire } from "module"; const require = createRequire(import.meta.url); const data = require("./data.json");
  15. Oct 2021
  16. moz.com moz.com