Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A standard notation to target contents inside structured data formats (XML, JSON)?

Here's the problem: I'm in a Web environment and I have data expressed in some structured format, say XML or JSON. I want to target elements inside these representations.

Here's an example:

The XML representation of a zoo:

<?xml version="1.0" encoding="UTF-8" ?>
<zoo>
    <dog>Joe</dog>
    <cat>Alfred</cat>
    <mouse>Ricky</mouse>
</zoo>

The JSON representation of the same zoo:

{
  "zoo": {
    "dog": "Joe",
    "cat": "Alfred",
    "mouse": "Ricky"
  }
}

Say, I'd like to hit the dog's name.

I see that there are several technologies to accomplish the task but they are bound to the content type. XML has XPath or Xpointer, JSON has JSONPath and so on.

The question is: if XML and JSON are two ways of representing structured information (which are almost equivalent), do you know some high level, implementation-independent notation which is not bound to a specific representation?

CONSTRAINTS:

Please consider that I can't go with the plain URL mechanism. I mean, I can't do something like http://authority/.../zoo/dog.

Here the resource is the zoo, I need to traverse its content (treating it as a content).

Just to clarify a little, something like http://authority/.../zoo#dog would do the trick because it separates the resource name (what stands before the #) from the content name (what stands after the #) but I'm not sure whether if using it in this way can be considered standard or not. In addition, the # strategy requires that the resource is annotated with anchor points, which is not desirable for my case.

like image 586
MaVVamaldo Avatar asked Oct 03 '22 01:10

MaVVamaldo


1 Answers

The question is: if XML and JSON are two ways of representing structured information (which are almost equivalent), do you know some high level, implementation-independent notation which is not bound to a specific representation?

Here are a few:

  • Resource Description Framework(RDF)
  • Abstract Syntax Notation(ASN.1)
  • Property List(PList)
  • Registry Files(Reg)
  • OData
  • Microdata
  • EXI
  • Canonical S-Expressions(Canonical S-expr)

References

  • Media Types Issues for Text RDF Formats
  • RDF Serializations
  • RDF Translator
  • Abstract Syntax Notation One (ASN.1) Recommendations
  • Overview of the JSON Encoding Rules (JSON/ER): a set of encoding rules for ASN.1
  • Darwin Plist Man Page
  • Property List Representations
  • Introduction to Property Lists
  • Old-Style ASCII Property Lists
  • Property List XML Tags
  • Distributing Registry Changes
  • How to Create a Brand New Registry Hive
  • Registering COM Applications
  • How to: Create a Registry Key and Set Its Value in Visual Basic
  • Create and implement an XPCOM component for the Firefox browser
  • Distributing Registry Changes
  • JSON/XML-RPC Client and Server
  • Concise Binary Object Representation (CBOR)
  • Adjacency List — NetworkX 1.10 documentation
  • jsonGRDDL: JSON/XML GRDDL Client and Server
  • Linked Data API: Formatting Graphs
  • OData and Schema.org (pdf)
  • Microdata: Extracting JSON
  • W3C Wiki: WebSchemas
  • Microdata to RDF: Second Edition
  • Microdata for Dummies: Extracting Semantic Annotations
  • EXI for JSON
  • JSONPointer/XPointer
  • Certificate Library Services API
  • US6779120: Declarative language for specifying a security policy
  • XML Signature Syntax and Processing Version 1.1
  • oEmbed makes embedding third party videos and images a breeze
like image 74
Paul Sweatte Avatar answered Oct 22 '22 21:10

Paul Sweatte