Publication Date: 2017-06-16
Approval Date: 2017-03-23
Posted Date: 2016-12-21
Reference number of this document: OGC 16-053r1
Reference URL for this document: http://www.opengis.net/doc/PER/t12-A086
Category: Public Engineering Report
Editor: Joan Masó
Title: Testbed-12 OWS Context: JSON, JSON-LD and HTML5 ER
COPYRIGHT
Copyright © 2016 Open Geospatial Consortium. To obtain additional rights of use, visit http://www.opengeospatial.org/
WARNING
This document is an OGC Public Engineering Report created as a deliverable of an initiative from the OGC Innovation Program (formerly OGC Interoperability Program). It is not an OGC standard and not an official position of the OGC membership.It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard. Further, any OGC Engineering Report should not be referenced as required or mandatory technology in procurements. However, the discussions in this document could very well lead to the definition of an OGC Standard.
LICENSE AGREEMENT
Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement.
If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.
THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD. THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.
This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.
Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications.
This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.
None of the Intellectual Property or underlying information or technology may be downloaded or otherwise exported or reexported in violation of U.S. export laws and regulations. In addition, you are responsible for complying with any local laws in your jurisdiction which may impact your right to import, export or use the Intellectual Property, and you represent that you have complied with any regulations or registration procedures required by applicable law to make this license enforceable.
- 1. Introduction
- 2. References
- 3. Terms and definitions
- 4. Conventions
- 5. Overview
- 6. Mapping OWS context conceptual model to Schema.org semantics.
- 7. Applying the Schema.org mapping to encode OWS context as HTML pages.
- 8. Adding CSS to the RDFa encoding
- 9. Adding JavaScript events to the RDFa encoding
- Appendix A: Revision History
- Appendix B: Bibliography
At the time of finalizing this ER the OGC TC has approved the OWS Context JSON encoding that is available here: http://www.opengeospatial.org/standards/owc This is the second encoding proposed for the OWS context standard precided by the Atom Encoding [OGC 12-084r2]. The OWS Context JSON enconding is based on the GeoJSON IETF standard [RFC7946]. The standard is a combination of two approaches:
-
mapping between the OWS Context conceptual model [12-080r2] to the basic structure of a GeoJSON file.
-
a direct conversion of the rest of the atom keys and the specific OWS Context XML into JSON following OGC 14-009r1.
The conversion was designed with current GeoJSON viewers in mind (including the one embedded in GitHUB) and making possible that they can visualize a OWS Context GeoJSON file without any modifications.
This ER focus on describing another encoding (a 3rd alternative) that allows for exposing geospatial resources on the web in a way that web browsers and search engines can better understand. It is widely known that HTML was designed with the linking capacity in mind. Both, users reading HTML and automatic crawlers, transverse links constantly. HTML seems the natural selection for linking geospatial data on the web. The question is how to complement the linking mechanism with some additional metadata that search engines could use for indexing. A solution could come from a mechanism which web search engines already have agreed to use for better indexing: schema.org.
Schemna.org proposes three enconding for their data model: Microdata, RDFa and JSON-LD. The reader might easily get confused by the fact that OGC approved a JSON encoding for OWS context and another JSON encoding emerges in this document. This ER is NOT proposing to replace or modify the currently approved JSON enconding for OWS context based on GeoJSON. The intention is to map the OWS Context model into the schema.org model to recognize that they are very similar and propose a encoding in HTML5 that can be done in the 3 alternative proposed by schema.org.
This ER has the objective of providing a new encoding for OWS context that is based in HTML5 and schem.org with the hope that web crawlers can make a better indexation of it.
The mapping between the OWS Context and the schema.org vocabulary has a value in itself because of the crawlers but also because the semantic web is often using schema.org. This way, the mapping of OWS Context to schema.org using JSON-LD ecoding provides also a direct RDF alternative for OWS Context.
This ER is important for the OWS Context SWG and the OGC in general because it provides an alternative solution for encoding OWS context in HTML5.
The OWS Context SWG is exploring encodinga na applications of OWS Context and it can benefit from the work elaborated here.
ogcdocs, testbed-12, JSON, JSON-LD, Encoding, Context
OWS Context SWG
1. Introduction
1.1. Scope
This OGC® document proposes an alternative encoding for OWS Context based on a preexisting vocabulary standarized in schema.org.
This OGC® document describes an approach that can be used in web pages that expose geospatial resources to allow crawlers to understand geospatial data and its context.
This OGC® document is applicable to OWS context.
1.2. Document contributor contact points
All questions regarding this document should be directed to the editor or the contributors:
Name | Organization |
---|---|
Joan Masó |
UAB-CREAF |
1.3. Future Work
It is expected that this document may result in an alternative encoding for OWS Context
1.4. Foreword
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The Open Geospatial Consortium shall not be held responsible for identifying any or all such patent rights.
Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.
2. References
The following documents are referenced in this document. For dated references, subsequent amendments to, or revisions of, any of these publications do not apply. For undated references, the latest edition of the normative document referred to applies.
-
OGC 12-080r2 OGC OWS Context Conceptual Model
3. Terms and definitions
For the purposes of this report, the definitions specified Clause 4 of the OWS Context Conceptual Model [OGC 12-080r2] and in Clause 4 of the OWS Common Implementation Standard [OGC 06-121r9] shall apply. In addition, the following terms and definitions apply.
3.1. annotation
any marking on illustrative material for the purpose of clarification [ISO 19117:2002, definition 4.1]. NOTE: In the context of schema.org the _purpose_ of the annotation is to add a clarification in the form of a machine readable metadata entry.
3.2. schema
formal description of a model [ISO 19101:2002, definition 4.25] NOTE: In the context of this document, the "model" is the schema.org data model
3.3. validation
apply a set of rules to an instance document to check the conformity to an schema model
4. Conventions
4.1. Abbreviated terms
Some more frequently used abbreviated terms are:
-
CSS Cascading Style Sheets
-
HTML5 Hyper Text Markup Language version 5
-
JSON JavaScript Object Notation
-
JSON-LD JavaScript Object Notation - Linked Data
-
OWC OWS Context
-
OWS OpenGeospatial Web Services
-
RDF Resource Description Framework
-
RDFa Resource Description Framework in Attributes
4.2. Used parts of other documents
This document uses significant parts of the document tables in [OGC 12-080r2]. To reduce the need to refer to that document, this document copies some of those parts with small modifications. To indicate those parts to readers of this document, the largely copied columns have a header name starting with the three letter acronym OWC. This document uses significant parts of the names, types ans defitions of the data model explained in schema.org. To reduce the need to refer to that website, this document copies some of those parts with small modifications. To indicate those parts to readers of this document, the largely copied columns have a header name starting with the three letter abbreviation SCH.
4.3. Data dictionary tables
Column title | Column contents |
---|---|
Names (left column) |
Two names for each included parameter or association (or data structure). The first name is the UML model attribute or association role name. The second name uses the XML encoding capitalization specified in Subclause 11.6.2 of [OGC 06-121r3]. The name capitalization rules used are specified in Subclause 11.6.2 of [OGC 06-121r3]. Some names in the tables may appear to contain spaces, but no names contain spaces. |
Definition (second column) |
Specifies the definition of this parameter (omitting un-necessary words such as “a”, “the”, and “is”). If the parameter value is the identifier of something, not a description or definition, the definition of this parameter should read something like “Identifier of TBD”. |
Data type and value (third column) or Data type (if are no second items are included in rows of table) |
Normally contains two items: The mandatory first item is often the data type used for this parameter, using data types appropriate in a UML model, in which this parameter is a named attribute of a UML class. Alternately, the first item can identify the data structure (or class) referenced by this association, and references a separate table used to specify the contents of that class (or data structure). The optional second item in the third column of each table should indicate the source of values for this parameter, the alternative values, or other value information, unless the values are quite clear from other listed information. |
Multiplicity and use (right or fourth column) or Multiplicity (if are no second items are included in rows of table) |
Normally contains two items: The mandatory first item specifies the multiplicity and optionality of this parameter in this data structure, either “One (mandatory)”, “One or more (mandatory)”, “Zero or one (optional)”, or “Zero or more (optional)”. The second item in the right column of each table should specify how any multiplicity other than “One (mandatory)” shall be used. If that parameter is optional, under what condition(s) shall that parameter be included or not included? If that parameter can be repeated, for what is that parameter repeated? |
The data type of many parameters, in the third table column, is specified as “Character String type, not empty”. In the XML Schema Documents specified herein, these parameters are encoded with the xsd:string type, which does NOT require that these strings not be empty.
In many tables in this document, and for readability reasons, the columns Name, Datatype, and Multiplicity and use have been fused in a single column with the three concepts separated in three lines. Additional columns have been added when comparing the OWS Context conceptual model and the Schema.org data model.
5. Overview
One of the main use cases for having an HTML5 encoding of OWS Context is to get better results in web search engines, when looking for geospatial information, without having to provide ISO metadata documents but only some context information. In addition, we aim at web search responses that are provided in better presentations of the items found as a easy to interpret result page. To achieve this aim, we need a vocabulary and encoding to annotate geospatial resources. The starting point is to consider that current web crawlers work better with HTML pages than with other formats (e.g. XML) and that schema.org vocabularies are helping crawlers to do a better job. The following clauses are devoted to the mapping OWS Context to schema.org concepts and to the encodings used to do that. This way, it will be possible to create HTML versions of OWS Context documents exposing geospatial data in the web, and find them in the same way we find information in a search engine.
Another important use case is to being able to create widgets of a geospatial information that can be integrated in a web map portal (commonly called integrated clients in the Testbeds). This can be achieved using a personalized nd compact presentation of OWS context document encoded in HTML. In addition to presentation, they can also contain interactive features (called behaviors) by adding JavaScript.
5.1. Schema.org concepts
Schema.org provides both a vocabulary and strategies to embed metadata within existing content on web pages. Search engines, web crawlers, and browsers can extract and process schema.org suggested encodings from a web page and use them to provide a richer browsing experience for users (e.g. Google, Microsoft and Yahoo! already rely on this markup). In particular, schema.org helps web search engines to provide more relevant results to users. Schema.org vocabularies provide the semantics, or meaning of an Item. In fact, schema.org is also an annotating mechanism in HTML elements with machine-readable tags. In the next subclause, we will focus on the vocabulary and we will compare it to the OWS Context Conceptual model.
A collection of commonly used markup vocabularies are provided by Schema.org which include metadata tags for describing: a Person, Event, Organization, Product, Review, Review-aggregate, Breadcrumb, Offer, Offer-aggregate, etc. Schema.org recommends that, when possible, authors re-use existing vocabularies, as a way to make content easy to re-use. It is also possible to create a custom vocabulary that better fits a new purpose. However, in this document, we strictly followed the current elements and we did not extend any of the current existing vocabularies. The intent is to maximize the interoperability of the proposed solution with the current applications.
This document explores the use of schema.org common vocabularies to describe geospatial resources. Our purpose is to illustrate how this approach could work in practice and present the solution as a possible encoding for OWS Context in HTML5 that could be standardized in the corresponding Standards Working Group. To demonstrate that the solution strictly follows the schema.org common practice and we are able to interoperate, we made sure that all presented examples validate in the Google Structured Data Testing Tool (https://developers.google.com/structured-data/testing-tool/).
In the OGC 15-053 Testbed-11 Implementing JSON/GeoJSON Engineering Report, some preliminary encodings in HTML Microdata and JSON-LD were suggested. In the examples prsented, the “Product” vocabulary was used. The possibility to create a web page enumerating a list of products (http://schema.org/Product) and, for each product, to include one or more offers (http://schema.org/Offer) was illustrated. Therefore, in this document we extended this proposal and provided a mapping between OWS Contexts to Schema.org concepts. The Product concept is mapped to the resource concept in OWS Context and the Offer concept to the offering concept in OWS Context. The instances of OWS Contest should be structured in two sections: the general metadata describing the context document, and the list of resources. To encode the general metadata part of a OWS Context, we used mainEntityOfPage (that is a CreativeWork). We were also using http://schema.org/Place to encode a citation of a place. In schema.org a Place can be described in different ways, including a physical postal address or also a “geo” element. A “geo” element can be a GeoCoordinates or a GeoShape. GeoCoordinates is an element that describes the position of a single point. It includes a longitude, a latitude and an elevation (and all the properties coming from Thing). On the contrary, GeoShape (see http://schema.org/GeoShape) provides 4 additional geometries to describe a Place: box, circle, line and polygon; all accompanied by a single elevation. The description of the geometries is done in text in a very simple from. Indeed, it does not specify the number of dimensions (2 are assumed) and coordinates are space separated. Polygons do not allow holes, and lines do not allow multi-linestrings. Even if there are limitations in Place, it provides enough possibilities for the needs of the OWS Context where, in many times, the geometric description of a resource requires just a bounding box (i.e. a simple envelop).
It is not possible to make a exact one-to-one mapping between the OWS Context and schema.org but most of the elements and attributes can easily paired. Only few properties needed some relaxed semantics interpretation of the definitions. Validation with no errors in the Google Structured Data Testing Tool was a condition in making the final proposed mapping.
5.2. Schema.org encodings
Schema.org includes three different encodings for the common concepts presented: Microdata, RDFa and JSON-LD. The first two encodings (Microdata and RDFa) provide ways to embed annotations in HTML pages. In practice, they are really similar and a simple text search-and-replace procedure can be used to go from one to the other. They can be considered HTML encodings since they use HTML markup to include metadata information.
An additional encoding is suggested that that is included a separate section (commonly at the beginning of the HTML page) that uses a JSON-LD representation of the schema.org concepts. This JSON-LD encoding has an extra bonus: it can be converted into RDF triples automatically. This connects directly to the Linked Data world.
Even if Google is recommending the use of the JSON-LD encoding, there are two main reasons why we are minimizing this alternative (and favoring the other two) in this document:
-
The JSON-LD encoding completely uncouples the HTML content not adding the semantics to the HTML itself in the way Microdata or RDFa annotations do. This impedes personalizing the HTML visualization styles of the content or to associate behaviours to HTML fragments anchored to the semantic annotations. This property is exploited in this ER.
-
There is already an specified JSON encoding for OWS Context. Adding another one can generate confusing among users of OWS Context.
5.3. Visualization styles and element behaviors.
The use of Microdata or RDFa encodings based on HTML annotations allows for using CSS selectors and JavaScript DOM document selectors to access parts of the semantic annotated HTML and change some visualization styles and add behaviors (events) to the annotated parts of the HTML code. The clauses Adding CSS to the RDFa encoding and Adding JavaScript events to the RDFa encoding explore the possibilities that this approach opens.
5.4. Overlap of JSON-LD for Schema.org and OWS Context GeoJSON.
The intention is not to create a competing alternative encoding for the OWS Context GeoJSON encoding but actually knowledge the existence of an automatic JSON-LD encoding. Please remember that there is no official representation of GeoJSON in an JSON-LD encoding. JSON-LD makes possible to transform a OWS Context into RDF triples. The reader could consider that a solution for the overlap of JSON-LD for Schema.org and OWS Context GeoJSON could consist in try to harmonize them in a single alternative. In the future, if the proposal here is accepted for the standard process, an update of the OWS Context GeoJSON encoding to include JSON-LD could be attempted. However, the authors of this document consider this approach very challenging (and probably not worthwhile), because both JSON encondings have very different origins with two independent conceptual models behind coming from two different communities. Indeed, in GeoJSON encoding a OWS Context is a sequence of geospatial features (mainly representing envelopes) with some attributes. In the Schema.org JSON-LD, a OWS Context is a collection of products that has several attributes including a geospatial boundary. In the standaridization process, the Standards Group could consider to exclude the JSON-LD from the possible schema.org encodings to avoid the confusion that having two JSON(-LD) encodings could create, but this will also remove the RDF triple automatic transformation that can be automatically derived.
6. Mapping OWS context conceptual model to Schema.org semantics.
This section provides a complete mapping between OWS Context conceptual model and Schema.org vocabulary in the form of several tables of equivalence. All tables (except the first one) use the same structure where the first 2 columns describe the element as in the OWS Context conceptual model and the next additional 2 columns describe schema.org element that maps to it and it is considered equivalent.
This section, combined with some examples provided in this document, can be the bases for elaborating a OWS Context HTML encoding extension standard in the near future.
OWS context conceptual model | Schema.org equivalences | http://Schema.org type |
---|---|---|
owc context document |
||
owc:Context root |
mainEntityOfPage |
|
owc:Creator |
mainEntityOfPage:associatedMedia |
|
owc:Resource |
itemListElement |
|
owc:Offering |
itemListElement:offers |
|
owc:Operation |
itemListElement:offers:potentialAction:target |
|
owc:Content |
itemListElement:offers:potentialAction |
|
owc:StyleSet |
itemListElement:offers:potentialAction |
The table above summarizes how the main classes of the OWS Context are mapped to the Schema.org concepts. A context document is mainly composed by two parts: a set of metadata describing the document as a whole and a list of resources, each one described by metadata. A key aspect of this mapping is to consider that geospatial resources can be mapped as schema.org Product's. Then, a list of products can be created using the ItemList concept. A ItemList can contain metadata describing the whole set (the document as a whole) by considering the OWS context document as an entity and using mainEntityOfPage. Product objects are very handy because they have offers to describe the way the geospatial products are "distributed" and potentialAction's that can be used as placeholders for OWS Context Operations, Content and StyleSet.
6.1. owc:context (root)
The following table describes the equivalences between the OWS Context conceptual root class and schema.org. All metadata elements of the OWS Context that are part of the root class, except the list of resources, are encapsulated in a mainEntityOfPage element and the attributes of mainEntityOfPage (of the CreativeWork type) are mapped to the OWS context root class element.
OWC Name OWC Data type OWC Multiplicity and Use |
OWC Definition | SCH main- EntityOfPage (https://schema.org/CreativeWork) SCH Data type |
SCH Description |
---|---|---|---|
specReference |
Specification Reference identifying that this is an owc Context document |
schemaVersion |
Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using a URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application. |
language |
Language used in the owc Context document |
inLanguage |
The language of the content or performance or used in an action. Please use one of the language codes from the IETF BCP 47 standard. Supersedes language. |
id |
Unique Identifier assigned to the OWS Context Document |
sameAs |
URL of a reference Web page that unambiguously indicates the item’s identity. E.g. the URL of the item’s Wikipedia page, Freebase page, or official website. |
title |
A Human Readable Title for the OWS Context Document |
name |
The name of the item |
abstract |
Description of the Context Document Purpose/Content |
description |
A short description of the item. |
updateDate |
Date when the Context Document was updated |
dateModified |
The date on which the CreativeWork was most recently modified or when the item’s entry was modified within a DataFeed. |
author |
Identifier for the author of the document |
author |
The author of this content. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably. |
publisher |
Identifier for the publisher of the document |
publisher |
The publisher of the creative work. |
creator |
The tool/application used to create the context document and its properties |
associatedMedia |
A media object that encodes this CreativeWork. This property is a synonym for encoding. |
rights |
Rights which apply to the context document |
copyrightHolder, copyrightYear, publishing- |
The party holding the legal copyright to the CreativeWork. The year during which the claimed copyright for the CreativeWork was first asserted. Link to page describing the editorial principles of the organization primarily responsible for the creation of the CreativeWork. A license document that applies to this content, typically indicated by URL. |
areaOfInterest |
Geographic area of interest of the users of the context document |
content- |
The location depicted or described in the content. For example, the location in a photograph or painting. |
timeIntervalOf- |
A date/time interval relevant to the context document |
contentLocation:- |
Date of first broadcast/publication. |
keyword |
Keyword related to this context document. Shall support an optional codelist parameter. |
keywords |
Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas. |
resource |
The description of a resource and its access parameters and configuration |
../itemListElement |
|
contextMetadata |
Additional metadata describing the context document itself. The format recommendation is ISO19115 complaint metadata. The metadata standard used should be specified |
discussionUrl |
A link to the page containing the comments of the CreativeWork. |
extension |
Any encoding should allow the user to extend the context content to include custom items |
any other element |
It is worth mentioning that Schema.org vocabulary provides several alternatives to describe geometries in the Place object (geo property of the CreativeWork). This is used here to describe the areaOfInterest of the OWS Context document. This object will require special attention when defining a concrete encoding for OWS Context in HTML to guarantee interoperability.
6.2. owc:creator (root):
OWS Creator is a complex type that is mapped to schema.org associatedMedia and is discussed in independent tables below.
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name in MediaObject (type:
https://schema.org/MediaObject) SCH Data type |
SCH Description |
---|---|---|---|
creatorApplication |
The name, reference and version of the creator application used to create the context document |
associatedMedia |
|
creatorDisplay |
Properties of the display in use when the context document was created (for display based applications only). |
associatedMedia |
|
extension |
Any encoding should allow the user to extend the Creator information to include custom items |
any other element |
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name in MediaObject (type:
https://schema.org/MediaObject) SCH Data type |
SCH Description |
---|---|---|---|
title |
Title or name of the application (for display purposes) |
name |
The name of the item. |
uri+ URI+ Zero or one (optional) |
URI describing the creator application. |
url |
URL of the item. |
version |
Version of the application. |
version |
The version of the CreativeWork embodied by a specified resource. |
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name in MediaObject (https://schema.org/MediaObject) SCH Data type |
SCH Description |
---|---|---|---|
pixelWidth |
Pixel width of the display specified by Area of Interest. |
width:value |
The width of the item. |
pixelHeight |
Pixel height of the display specified by Area of Interest. |
height:value |
The height of the item. |
mmPerPixel |
The number of mm per pixel for the display. If no value is available the field should be set to NULL. |
width:value- |
A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature. |
extension |
Any encoding should allow the user to extend the display information to include custom items |
any other element |
6.3. owc Resource
A OWS context resource is mapped to a Schema.org Product as described in the following table.
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name Product
(https://schema.org/Product) SCH Data type |
SCH Description |
---|---|---|---|
id |
Unique Identifier assigned to the owc Resource. Used to reference a resource from other resources |
sameAs productID |
URL of a reference Web page that unambiguously indicates the item’s identity. E.g. the URL of the item’s Wikipedia page, Freebase page, or official website. The product identifier, such as ISBN. For example: . |
title |
A Human Readable Title for the owc Resource. |
name |
The name of the item. |
abstract |
Description of the Context Document Purpose/Content |
description |
A short description of the item. |
updateDate |
Date when the resource definition was updated |
releaseDate |
The release date of a product or product model. This can be used to distinguish the exact variant of a product. |
author |
Identifier for the author of the resource definition |
manufacturer |
The manufacturer of the product. |
publisher |
Identifier for the publisher of the resource definition |
brand |
The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person. |
rights |
Rights which apply to the resource definitiona |
additionalProperty:value (additionalProperty:name=rights) |
|
geospatialExtent |
The geographic extent of the resourceb |
additionalProperty:value (additionalProperty:name=box) |
|
temporalExtent |
The temporal extent of the content of the resource |
productionDate |
The date of production of the item, e.g. vehicle. |
contentDescription+
Any |
A reference to a description of the Context resource in alternative format. |
alternateName |
An alias for the item. |
preview |
A URI identifying a preview of the resource |
image |
An image of the item. This can be a URL or a fully described ImageObject. |
contentByRef |
A URI identifying a service which will return an immediately exploitable result by simply requesting based on the URI. The expectation is that the return type of this call will be a well-known format |
url |
URL of the item |
offering |
Service or inline content offering for the resource targeted at OGC compliant clients |
offers |
An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. |
active |
This flag indicates the state of the resource within the context document. It can be interpreted by the caller as required (this may be defined in a profile or in the specific service extensions) |
additionalProperty:value (additionalProperty:name=active) |
|
keyword |
Keyword related to this resource definition. Shall support an optional codelist parameter. |
additionalProperty:value (additionalProperty:name=keywords) |
|
minScale- |
Minimum scale for the display of the layer. |
additionalProperty:minValue (additionalProperty:name=Scale denominator) |
|
maxScale- |
Maximum scale for the display of the layer. |
additionalProperty:maxValue (additionalProperty:name=Scale denominator) |
|
resourceMetadata |
Metadata about the resource itself |
review |
A review of the item. |
folder+ CharacterString+ Zero or one (optional) |
Definition of the folder structure in which the resource is placed. |
additionalProperty:maxValue (additionalProperty:name=Folder) |
|
extension |
Any encoding should allow the user to extend the resource content to include custom items |
any other element |
Unfortunately, there is no geometrical description in a Product to directly map OWS Context geospatialExtent. However, Product as an extension point property called additionalProperty that could be used to include a bounding box or more complex form to describe the extent. This object will require special attention when defining a concrete encoding for OWS Context in HTML to guarantee interoperability.
6.4. owc Offering
A OWS context resource can provide an immediate reference to geospatial information (using contentByRef). In addition, geospatial data can be offered in one or more formats or by services that are mapped to a Schema.org Offer as described in the following table.
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | Schema.org name Offer (type:
https://schema.org/Offer) Data type in schema.org |
description in schema.org |
---|---|---|---|
code |
Code identifying the type of service offering a |
additionalType |
An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. |
operation |
Operations used to invoke the service a |
potentialAction/target |
|
content |
inline content |
potentialAction |
|
styleSet |
Style sets to style the in-line content |
potentialAction |
|
extension |
Application specific content |
any other element |
6.4.1. owc Operation
OWS Context offerings describe services that provide access to geospatial resources through operations. An schema.org Offer has a potentialAction attribute that can serve the same purpose, as described in the following table.
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name EntryPoint
(https://schema.org/entryPoint) SCH Data type |
SCH Description |
---|---|---|---|
code |
Code identifying the type of Operationa |
additionalType |
An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. |
method |
Name of openration method request |
httpMethod |
An HTTP method that specifies the appropriate HTTP method for a request to an HTTP EntryPoint. Values are capitalized strings as used in HTTP. |
type |
MIMEType of the return result |
contentType |
The supported content type(s) for an EntryPoint response. |
requestURL |
Service Request URLb |
url, urlTemplate |
URL of the item. A url template (RFC6570) that will be used to construct the target of the execution of the action. |
payload |
Payload for non-http get operationsc |
description |
A short description of the item. |
result |
result of the operation (optional) |
../result |
The result produced in the action. e.g. John wrote a book. |
extension |
Application specific content |
any other element |
In OWS Context an operation describes a "request" and a "response". The request is composed by a url and a payload that are mapped to url and description in the schema.org vocabulary. Sometimes, OWS Context operation can also include the Content of the response that can be mapped to a Thing as described in following table.
6.5. owc Content
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name Action
(https://schema.org/Action) SCH Data type |
SCH Description |
---|---|---|---|
type |
Type of the inline content |
additionalType |
An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. |
URL |
Referenced Content |
url |
URL of the item. |
content |
Actual content in the content element |
result |
The result produced in the action. e.g. John wrote a book. |
extension |
Application specific content |
any other element |
6.6. owc StyleSet
Style can be indicated in a OWS Context as a recommended default symbology to present some resources in the screen. In practice, style is assigned to a geospatial resource by applying the symbology to the geospatial resources. We use the assumtion that there is a portrayal mechanism, we use another Action to describe the style. Applying styles to data in OWS context still requires more experimentation, both in general and also in relation to this mapping.
OWC Name OWC Data Type OWC Multiplicity and Use |
OWC Definition | SCH name Action
(https://schema.org/Action) SCH Data type |
SCH Description |
---|---|---|---|
name |
Unique name of the styleSet within a given offering |
name |
The name of the item. |
title |
A Human Readable Title for the OWS Context Document |
alternateName |
An alias for the item. |
abstract |
Description of the Style |
description |
A short description of the item. |
default |
Whether this Styleset is the one to be used as default (initial display) |
actionStatus/name="used" |
Indicates the current disposition of the Action. |
legendURL |
URL of a legend image for the style |
image |
An image of the item. This can be a URL or a fully described ImageObject. |
content |
The in-line or an external reference to the style definition |
url description |
URL of the item. Short description of the item |
extension |
Any encoding should allow the user to extend the style definition to include custom items |
any other element |
7. Applying the Schema.org mapping to encode OWS context as HTML pages.
The previous section provided a mapping of OWS context into schema.org vocabularies. In this section we explore how this mapping can be used to generate encodings. As said before, schema.org includes 3 different encodings for the concepts: Microdata, RDFa and JSON-LD. This section presents the same example in each of the 3 encoding. As previously discussed, the JSON-LD encoding is presented here for completeness but next sections will demonstrate that Microdata and RDFa encodings can have additional advantages.
This section takes one of the examples in the OGC official schema repository and converts it to schema.org Microdata, RDFa and JSON-LD encodings. The example contains two resources that are provided as services. The original example is encoded in XML Atom and can be downloaded from: http://schemas.opengis.net/owc/1.0/examples/wms_scale.xml
The example shows how to have a main description of the context document (in the mainEntityOfPage), how to create a list of resources (in itemListElement), and a list of offerings for each resource (in offers), and a list of operations (in potentialAction).
The first two encodings (Microdata and RDFa) are really similar and a simple text search-and-replace procedure can be used to go from one to the other. They can be considered HTML encodings since they use HTML markup to include metadata information. Also note that the encoding provide semantic tagging to HTML content. In contrast, the JSON-LD encoding is completely independent from the HTML content even if it is embbeded in the headers of the HTML page.
All 3 encodings examples have been tested in https://developers.google.com/structured-data/testing-tool/, returning an "All good" message.
7.1. Example of a OWS Context document in Microdata and RDFa.
In both encodings, <div>, <span, <h1>…<h6> and <a> tags are used to separate the content of the page in HTML nodes of the DOM that can be semantically tagged with attributes.
The following table summarizes the attributes used to semantically tag the HTML sections.
Concept | Microdata | RDFa |
---|---|---|
Root object enclousure |
itemscope="itemscope" |
vocab="http://schema.org/" |
Object enclousure |
itemscope="itemscope" |
N/A |
Object type |
itemtype="http://schema.org/$$$" |
Attribute name |
itemprop="$$$" |
property="$$$" |
Attribute value |
<html> <div itemscope="itemscope" itemtype="http://schema.org/ItemList"> <div itemprop="mainEntityOfPage" itemscope="itemscope" itemtype="http://schema.org/CreativeWork"> <span itemprop="schemaVersion" content="http://www.opengis.net/spec/owc-atom/1.0/req/core"/> <span itemprop="sameAs" content="http://www.opengis.net/owc/1.0/examples/WMS_scale"/> <h1 itemprop="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h1> <b>Description:</b> <span itemprop="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/> <b>Updated date:</b> <span itemprop="dateModified" content="2012-11-04T17:26:23Z">2012/11/04 17:26:23</span> <div itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person"> <b>Autor:</b> <span itemprop="name" content="Joan Maso">Joan Maso</span> </div> <div itemprop="publisher" itemscope="itemscope" itemtype="http://schema.org/Organization"> <b>Publisher:</b> <span itemprop="name" content="CREAF">CREAF</span> </div> <div itemprop="associatedMedia" itemscope="itemscope" itemtype="http://schema.org/MediaObject"> <b>Recommended screen size:</b> <div itemprop="width" itemscope="itemscope" itemtype="http://schema.org/QuantitativeValue"> <b>width:</b> <span itemprop="value" content="600">600</span> <span itemprop="valueReference" itemscope="itemscope" itemtype="http://schema.org/QuantitativeValue"> <span itemprop="name" content="mmPerPixel"/> <span itemprop="value" content="0.28"/> </span> </div> <div itemprop="height" itemscope="itemscope" itemtype="http://schema.org/QuantitativeValue"> <b>height:</b> <span itemprop="value" content="400">400</span><br/> <span itemprop="valueReference" itemscope="itemscope" itemtype="http://schema.org/QuantitativeValue"> <span itemprop="name" content="mmPerPixel"/> <b>mm per pixel:</b> <span itemprop="value" content="0.28">0.28</span> </span> </div> <b>Creator application:</b> <span itemprop="name" content="MiraMon">MiraMon</span> (<span itemprop="url" content="http://www.creaf.uab.cat/MiraMon">http://www.creaf.uab.cat/MiraMon</span>) </div> <div itemprop="copyrightHolder" itemscope="itemscope" itemtype="http://schema.org/Organization"> <b>Rights owner:</b> <span itemprop="name" content="ICGC">ICGC</span> </div> <div itemprop="contentLocation" itemscope="itemscope" itemtype="http://schema.org/Place"> <div itemprop="geo" itemscope="itemscope" itemtype="http://schema.org/GeoShape"> <b>Bbox location:</b> <span itemprop="box" content="414475,4567125 451575,4588025">414475,4567125 451575,4588025</span> </div> <div itemprop="additionalProperty" itemscope="itemscope" itemtype="http://schema.org/PropertyValue"> <span itemprop="name" content="timeIntervalOfInterest"/> <b>Temporal span:</b> <span itemprop="value" content="2012-01-01T00:00:00Z, 2012-06-01T00:00:00Z">2012-01-01/2012-06-01</span> </div> </div> <b>Keywords:</b> <span itemprop="keywords" content="WMS">WMS</span> </div> <div itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"> <div itemprop="item" itemscope="itemscope" itemtype="http://schema.org/Product"> <h2 itemprop="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h2> <span itemprop="productID" content="http://shagrat.icc.es/lizardtech/iserv/ows/orto5m"/> <b>Description:</b> <span itemprop="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/> <span itemprop="image" content="http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png"/><img src="http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png"/><br/> <b>Updated date:</b> <span itemprop="releaseDate">2012-11-01T00:00:00Z</span> <div itemprop="manufacturer" itemscope="itemscope" itemtype="http://schema.org/Organization"> <b>Author:</b> <span itemprop="name">ICGC</span> (<span itemprop="email">icgc@icgc.cat</span>) </div> <div itemprop="brand" itemscope="itemscope" itemtype="http://schema.org/Organization"> <b>Publisher:</b> <span itemprop="name">CREAF</span> </div> <div itemprop="additionalProperty" itemscope="itemscope" itemtype="http://schema.org/PropertyValue"> <span itemprop="name" content="box"/> <b>BBox:</b> <span itemprop="value">414475,4567125 451575,4588025</span> </div> <div itemprop="additionalProperty" itemscope="itemscope" itemtype="http://schema.org/PropertyValue"> <span itemprop="name" content="ScaleDenominator"/> <b>Scales:</b> 1/<span itemprop="maxValue">25000</span> - 1/<span itemprop="minValue">2500</span> </div> <b>Description:</b> <span itemprop="alternateName">Barcelona Ortophoto image 1:5 000 produced by the Institut Cartografic de Catalunya (the more recent one)</span> <div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer"> <h3>WMS</h3> <span itemprop="additionalType">http://www.opengis.net/spec/owc-atom/1.0/req/wms</span> <div itemprop="potentialAction" itemscope="itemscope" itemtype="http://schema.org/Action"> <div itemprop="target" itemscope="itemscope" itemtype="http://schema.org/EntryPoint"> <h4>GetCapabilties</h4> <span itemprop="additionalType" content="http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetCapabilities"/> <span itemprop="httpMethod" content="GET"/> <span itemprop="contentType" content="application/xml"/> <b>URL:</b> <span itemprop="url">http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities</span> </div> </div> <div itemprop="potentialAction" itemscope="itemscope" itemtype="http://schema.org/Action"> <div itemprop="target" itemscope="itemscope" itemtype="http://schema.org/EntryPoint"> <h4>GetMap</h4> <span itemprop="additionalType">http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetMap</span> <span itemprop="httpMethod" content="GET"/> <span itemprop="contentType" content="image/jpeg"/> <b>URL:</b> <span itemprop="url">http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS& VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:23031& BBOX=414475,4567125,451575,4588025&WIDTH=600&HEIGHT=400&LAYERS=orto5m& FORMAT=image/jpeg&STYLES=</span> </div> </div> <span itemprop="price" content="0.00"/> </div> </div> </div> </div> </html>
<html> <div vocab="http://schema.org/" typeof="http://schema.org/ItemList"> <div property="mainEntityOfPage" typeof="http://schema.org/CreativeWork"> <span property="schemaVersion" content="http://www.opengis.net/spec/owc-atom/1.0/req/core"/> <span property="sameAs" content="http://www.opengis.net/owc/1.0/examples/WMS_scale"/> <h1 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h1> <b>Description:</b> <span property="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/> <b>Updated date:</b> <span property="dateModified" content="2012-11-04T17:26:23Z">2012/11/04 17:26:23</span> <div property="author" typeof="http://schema.org/Person"> <b>Autor:</b> <span property="name" content="Joan Maso">Joan Maso</span> </div> <div property="publisher" typeof="http://schema.org/Organization"> <b>Publisher:</b> <span property="name" content="CREAF">CREAF</span> </div> <div property="associatedMedia" typeof="http://schema.org/MediaObject"> <b>Recommended screen size:</b> <div property="width" typeof="http://schema.org/QuantitativeValue"> <b>width:</b> <span property="value" content="600">600</span> <span property="valueReference" typeof="http://schema.org/QuantitativeValue"> <span property="name" content="mmPerPixel"/> <span property="value" content="0.28"/> </span> </div> <div property="height" typeof="http://schema.org/QuantitativeValue"> <b>height:</b> <span property="value" content="400">400</span><br/> <span property="valueReference" typeof="http://schema.org/QuantitativeValue"> <span property="name" content="mmPerPixel"/> <b>mm per pixel:</b> <span property="value" content="0.28">0.28</span> </span> </div> <b>Creator application:</b> <span property="name" content="MiraMon">MiraMon</span> (<span property="url" content="http://www.creaf.uab.cat/MiraMon">http://www.creaf.uab.cat/MiraMon</span>) </div> <div property="copyrightHolder" typeof="http://schema.org/Organization"> <b>Rights owner:</b> <span property="name" content="ICGC">ICGC</span> </div> <div property="contentLocation" typeof="http://schema.org/Place"> <div property="geo" typeof="http://schema.org/GeoShape"> <b>Bbox location:</b> <span property="box" content="414475,4567125 451575,4588025">414475,4567125 451575,4588025</span> </div> <div property="additionalProperty" typeof="http://schema.org/PropertyValue"> <span property="name" content="timeIntervalOfInterest"/> <b>Temporal span:</b> <span property="value" content="2012-01-01T00:00:00Z, 2012-06-01T00:00:00Z">2012-01-01/2012-06-01</span> </div> </div> <b>Keywords:</b> <span property="keywords" content="WMS">WMS</span> </div> <div property="itemListElement" typeof="http://schema.org/ListItem"> <div property="item" typeof="http://schema.org/Product"> <h2 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h2> <span property="productID" content="http://shagrat.icc.es/lizardtech/iserv/ows/orto5m"/> <b>Description:</b> <span property="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/> <span property="image" content="http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png"/><img src="http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png"/><br/> <b>Updated date:</b> <span property="releaseDate">2012-11-01T00:00:00Z</span> <div property="manufacturer" typeof="http://schema.org/Organization"> <b>Author:</b> <span property="name">ICGC</span> (<span property="email">icgc@icgc.cat</span>) </div> <div property="brand" typeof="http://schema.org/Organization"> <b>Publisher:</b> <span property="name">CREAF</span> </div> <div property="additionalProperty" typeof="http://schema.org/PropertyValue"> <span property="name" content="box"/> <b>BBox:</b> <span property="value">414475,4567125 451575,4588025</span> </div> <div property="additionalProperty" typeof="http://schema.org/PropertyValue"> <span property="name" content="ScaleDenominator"/> <b>Scales:</b> 1/<span property="maxValue">25000</span> - 1/<span property="minValue">2500</span> </div> <b>Description:</b> <span property="alternateName">Barcelona Ortophoto image 1:5 000 produced by the Institut Cartografic de Catalunya (the more recent one)</span> <div property="offers" typeof="http://schema.org/Offer"> <h3>WMS</h3> <span property="additionalType">http://www.opengis.net/spec/owc-atom/1.0/req/wms</span> <div property="potentialAction" typeof="http://schema.org/Action"> <div property="target" typeof="http://schema.org/EntryPoint"> <h4>GetCapabilties</h4> <span property="additionalType" content="http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetCapabilities"/> <span property="httpMethod" content="GET"/> <span property="contentType" content="application/xml"/> <b>URL:</b> <span property="url">http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities</span> </div> </div> <div property="potentialAction" typeof="http://schema.org/Action"> <div property="target" typeof="http://schema.org/EntryPoint"> <h4>GetMap</h4> <span property="additionalType">http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetMap</span> <span property="httpMethod" content="GET"/> <span property="contentType" content="image/jpeg"/> <b>URL:</b> <span property="url">http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS& VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025& WIDTH=600&HEIGHT=400&LAYERS=orto5m&FORMAT=image/jpeg&STYLES=</span> </div> </div> <span property="price" content="0.00"/> </div> </div> </div> </div> </html>
7.2. Example of a OWS Context document in JSON-LD.
For simplicity we only present the JSON-LD encoding fragment that can be embedded in a web page.
Please, refer to the section Overlap of JSON-LD for Schema.org and OWS Context GeoJSON. for a discussion of the convenience of standardizing this particular encoding.
{ "@context": "http://schema.org", "@type": "ItemList", "mainEntityOfPage": { "@type": "CreativeWork", "schemaVersion": "http://www.opengis.net/spec/owc-atom/1.0/req/core", "sameAs": "http://www.opengis.net/owc/1.0/examples/WMS_scale", "name": "Ortophoto of Barcelona 1:5 000 [ICGC]", "description": "Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]", "dateModified": "2012-11-04T17:26:23Z", "author": { "@type": "Person", "name": "Joan Maso" }, "publisher": { "@type": "Organization", "name": "CREAF" }, "associatedMedia": { "@type": "MediaObject", "width": { "@type": "QuantitativeValue", "value": 600, "valueReference": { "@type": "QuantitativeValue", "value": 0.28, "name": "mmPerPixel" } }, "height": { "@type": "QuantitativeValue", "value": "400", "valueReference": { "@type": "QuantitativeValue", "value": 0.28, "name": "mmPerPixel" } }, "name": "MiraMon", "url": "http://www.creaf.uab.cat/MiraMon" }, "copyrightHolder": { "@type": "Organization", "name": "ICGC" }, "contentLocation": { "@type": "Place", "geo": { "@type": "GeoShape", "box": "414475,4567125 451575,4588025" }, "additionalProperty": { "@type": "PropertyValue", "name": "timeIntervalOfInterest", "value": "2012-01-01T00:00:00Z, 2012-06-01T00:00:00Z" } }, "keywords": "WMS" }, "itemListElement": [ { "@type": "Product", "productID": "http://shagrat.icc.es/lizardtech/iserv/ows/orto5m", "name": "Ortophoto of Barcelona 1:5 000 [ICGC]", "description": "Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]", "image": "http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png", "releaseDate": "2012-11-01T00:00:00Z", "manufacturer": { "@type": "Organization", "name": "ICGC", "email": "icgc@icgc.cat" }, "brand": { "@type": "Organization", "name": "CREAF" }, "additionalProperty": [{ "@type": "PropertyValue", "name": "box", "value": "414475,4567125 451575,4588025" },{ "@type": "PropertyValue", "name": "ScaleDenominator", "maxValue": 25000, "minValue": 2500 }], "alternateName": "Ortofotoimatge de Barcelona 1:5 000 de l'Institut Cartogrà fic de Catalunya (la més actual disponible)", "offers":[ { "@type": "Offer", "additionalType": "http://www.opengis.net/spec/owc-atom/1.0/req/wms", "potentialAction": [{ "@type": "Action", "target": { "@type": "EntryPoint", "additionalType": "http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetCapabilities", "httpMethod": "GET", "contentType": "application/xml", "url": "http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" } },{ "@type": "Action", "target": { "@type": "EntryPoint", "additionalType": "http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetMap", "httpMethod": "GET", "contentType": "image/jpeg", "url": "http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1& REQUEST=GetMap&SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025& WIDTH=600&HEIGHT=400&LAYERS=orto5m&FORMAT=image/jpeg&STYLES=" } }], "price": "0.00" }] } ] }
7.2.1. RDF triple automatic transformation
As explained before, the JSON-LD encoding can be converted into RDF triples automatically. This connects directly to the Linked Data world. To be able to do an elegant transformation, we need is add an identifier to each object in the JSON-LD encoding first.
{ "@context": ["http://schema.org", {"example":"http://www.opengis.net/owc/html5/ex1/"}], "@type": "ItemList", "@id": "example:wms", "mainEntityOfPage": { "@type": "CreativeWork", "@id": "example:wms_main", "schemaVersion": "http://www.opengis.net/spec/owc-atom/1.0/req/core", "sameAs": "http://www.opengis.net/owc/1.0/examples/WMS_scale", "name": "Ortophoto of Barcelona 1:5 000 [ICGC]", "description": "Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]", ... } ... }
Now, it is possible to use a JSON-LD engine to perform an automatic transformation to RDF triples. We have used the JSON-LD playground tool to do it.
<http://www.opengis.net/owc/html5/ex1/wms> <http://schema.org/itemListElement> <http://www.opengis.net/owc/html5/ex1/wms_res1> . <http://www.opengis.net/owc/html5/ex1/wms> <http://schema.org/mainEntityOfPage> <http://www.opengis.net/owc/html5/ex1/wms_main> . <http://www.opengis.net/owc/html5/ex1/wms> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/ItemList> . <http://www.opengis.net/owc/html5/ex1/creaf> <http://schema.org/name> "CREAF" . <http://www.opengis.net/owc/html5/ex1/creaf> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Organization> . <http://www.opengis.net/owc/html5/ex1/jm> <http://schema.org/name> "Joan Maso" . <http://www.opengis.net/owc/html5/ex1/jm> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/associatedMedia> <http://www.opengis.net/owc/html5/ex1/wms_ass_media> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/author> <http://www.opengis.net/owc/html5/ex1/jm> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/contentLocation> <http://www.opengis.net/owc/html5/ex1/wms_place> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/copyrightHolder> <http://www.opengis.net/owc/html5/ex1/wms_icgc> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/dateModified> "2012-11-04T17:26:23Z"^^<http://schema.org/Date> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/description> "Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]" . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/keywords> "WMS" . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/name> "Ortophoto of Barcelona 1:5 000 [ICGC]" . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/publisher> <http://www.opengis.net/owc/html5/ex1/creaf> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/sameAs> <http://www.opengis.net/owc/1.0/examples/WMS_scale> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://schema.org/schemaVersion> <http://www.opengis.net/spec/owc-atom/1.0/req/core> . <http://www.opengis.net/owc/html5/ex1/wms_main> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/CreativeWork> . <http://www.opengis.net/owc/html5/ex1/wms_icgc> <http://schema.org/name> "ICGC" . <http://www.opengis.net/owc/html5/ex1/wms_icgc> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Organization> . <http://www.opengis.net/owc/html5/ex1/wms_ass_media> <http://schema.org/height> <http://www.opengis.net/owc/html5/ex1/wms_media_h> . <http://www.opengis.net/owc/html5/ex1/wms_ass_media> <http://schema.org/name> "MiraMon" . <http://www.opengis.net/owc/html5/ex1/wms_ass_media> <http://schema.org/url> <http://www.creaf.uab.cat/MiraMon> . <http://www.opengis.net/owc/html5/ex1/wms_ass_media> <http://schema.org/width> <http://www.opengis.net/owc/html5/ex1/wms_media_w> . <http://www.opengis.net/owc/html5/ex1/wms_ass_media> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/MediaObject> . <http://www.opengis.net/owc/html5/ex1/wms_media_h> <http://schema.org/value> "400" . <http://www.opengis.net/owc/html5/ex1/wms_media_h> <http://schema.org/valueReference> <http://www.opengis.net/owc/html5/ex1/wms_media_h_v> . <http://www.opengis.net/owc/html5/ex1/wms_media_h> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/QuantitativeValue> . <http://www.opengis.net/owc/html5/ex1/wms_media_h_v> <http://schema.org/name> "mmPerPixel" . <http://www.opengis.net/owc/html5/ex1/wms_media_h_v> <http://schema.org/value> "2.8E-1"^^<http://www.w3.org/2001/XMLSchema#double> . <http://www.opengis.net/owc/html5/ex1/wms_media_h_v> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/QuantitativeValue> . <http://www.opengis.net/owc/html5/ex1/wms_media_w> <http://schema.org/value> "600"^^<http://www.w3.org/2001/XMLSchema#integer> . <http://www.opengis.net/owc/html5/ex1/wms_media_w> <http://schema.org/valueReference> <http://www.opengis.net/owc/html5/ex1/wms_media_w_v> . <http://www.opengis.net/owc/html5/ex1/wms_media_w> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/QuantitativeValue> . <http://www.opengis.net/owc/html5/ex1/wms_media_w_v> <http://schema.org/name> "mmPerPixel" . <http://www.opengis.net/owc/html5/ex1/wms_media_w_v> <http://schema.org/value> "2.8E-1"^^<http://www.w3.org/2001/XMLSchema#double> . <http://www.opengis.net/owc/html5/ex1/wms_media_w_v> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/QuantitativeValue> . <http://www.opengis.net/owc/html5/ex1/wms_place> <http://schema.org/additionalProperty> <http://www.opengis.net/owc/html5/ex1/wms_time> . <http://www.opengis.net/owc/html5/ex1/wms_place> <http://schema.org/geo> <http://www.opengis.net/owc/html5/ex1/wms_place_box> . <http://www.opengis.net/owc/html5/ex1/wms_place> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> . <http://www.opengis.net/owc/html5/ex1/wms_place_box> <http://schema.org/box> "414475,4567125 451575,4588025" . <http://www.opengis.net/owc/html5/ex1/wms_place_box> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoShape> . <http://www.opengis.net/owc/html5/ex1/wms_time> <http://schema.org/name> "timeIntervalOfInterest" . <http://www.opengis.net/owc/html5/ex1/wms_time> <http://schema.org/value> "2012-01-01T00:00:00Z, 2012-06-01T00:00:00Z" . <http://www.opengis.net/owc/html5/ex1/wms_time> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/PropertyValue> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/additionalProperty> <http://www.opengis.net/owc/html5/ex1/wms_res1_bbox> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/additionalProperty> <http://www.opengis.net/owc/html5/ex1/wms_res1_scale> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/alternateName> "Ortofotoimatge de Barcelona 1:5 000 de l'Institut Cartogrà fic de Catalunya (la més actual disponible)" . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/brand> <http://www.opengis.net/owc/html5/ex1/wms_res1_brand> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/description> "Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]" . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/image> <http://png-3.findicons.com/files/icons/1637/file_icons_vs_2/256/tiff.png> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/manufacturer> <http://www.opengis.net/owc/html5/ex1/wms_res1_man> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/name> "Ortophoto of Barcelona 1:5 000 [ICGC]" . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/offers> <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/productID> "http://shagrat.icc.es/lizardtech/iserv/ows/orto5m" . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://schema.org/releaseDate> "2012-11-01T00:00:00Z"^^<http://schema.org/Date> . <http://www.opengis.net/owc/html5/ex1/wms_res1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Product> . <http://www.opengis.net/owc/html5/ex1/wms_res1_bbox> <http://schema.org/name> "box" . <http://www.opengis.net/owc/html5/ex1/wms_res1_bbox> <http://schema.org/value> "414475,4567125 451575,4588025" . <http://www.opengis.net/owc/html5/ex1/wms_res1_bbox> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/PropertyValue> . <http://www.opengis.net/owc/html5/ex1/wms_res1_brand> <http://schema.org/name> "CREAF" . <http://www.opengis.net/owc/html5/ex1/wms_res1_brand> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Organization> . <http://www.opengis.net/owc/html5/ex1/wms_res1_man> <http://schema.org/email> "icgc@icgc.cat" . <http://www.opengis.net/owc/html5/ex1/wms_res1_man> <http://schema.org/name> "ICGC" . <http://www.opengis.net/owc/html5/ex1/wms_res1_man> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Organization> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> <http://schema.org/additionalType> <http://www.opengis.net/spec/owc-atom/1.0/req/wms> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> <http://schema.org/potentialAction> <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> <http://schema.org/potentialAction> <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> <http://schema.org/price> "0.00" . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Offer> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1> <http://schema.org/target> <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Action> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> <http://schema.org/additionalType> <http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetCapabilities> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> <http://schema.org/contentType> "application/xml" . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> <http://schema.org/httpMethod> "GET" . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> <http://schema.org/url> <http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act1_ep> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/EntryPoint> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2> <http://schema.org/target> <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Action> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> <http://schema.org/additionalType> <http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetMap> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> <http://schema.org/contentType> "image/jpeg" . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> <http://schema.org/httpMethod> "GET" . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> <http://schema.org/url> <http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025&WIDTH=600&HEIGHT=400& LAYERS=orto5m&FORMAT=image/jpeg&STYLES=> . <http://www.opengis.net/owc/html5/ex1/wms_res1_off1_act2_ep> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/EntryPoint> . <http://www.opengis.net/owc/html5/ex1/wms_res1_scale> <http://schema.org/maxValue> "25000"^^<http://www.w3.org/2001/XMLSchema#integer> . <http://www.opengis.net/owc/html5/ex1/wms_res1_scale> <http://schema.org/minValue> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> . <http://www.opengis.net/owc/html5/ex1/wms_res1_scale> <http://schema.org/name> "ScaleDenominator" . <http://www.opengis.net/owc/html5/ex1/wms_res1_scale> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/PropertyValue> .
8. Adding CSS to the RDFa encoding
8.1. Introduction
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language. In practice, CSS describes how HTML elements should be displayed by the web browser.
One of the available alternatives is that an HTML page embbedes a CSS fragment in the <style> section as shown in the following example (this is called inline CSS). The CSS encoding is not a classical markup language, so it does not resemble neither HTML nor XML. The format seems more close to JSON or C data structures. In the example, each block starts with a reference to an element or elements in the HTML DOM (we see references to the body section, as well as the h1 and p sections). Inside the "{}", a key an value sequence specifies the different properties that can be styled in HTML, such as colors, fonts, etc followed by the corresponding value.
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
font-size: 20px;
}
</style>
</head>
<body>
<h1>My First CSS Example</h1>
<p>This is a paragraph.</p>
</body>
</html>
For more details on how CSS functions, we recommend to follow the W3C Schools CSS tutorial.
This section presents an example that illustrates how to integrate CSS in the proposed OWS Context Schema.org encoding in HMTL with the objective of to improve and personalize the visualization of it. A use case will be to present one or more OWS context documents as small windows (widgets) in a web based map viewer interface and easily activate them when needed to be shown.
Instead of associating CSS styles to HTML element names, the proposal consists in using the HTML document annotations with schema.org vocabularies (in this case we will use RDFa annotations, but Microdata annotations will serve the same purpose) as the mechanism to refer to the individual elements and attributes that form the OWS Context document metadata entries. By doing so, we avoid the need to add an id to the HTML tags or to reference the entries in a different way depending on the type of HTML tag that was used to make the representation (div, span…). In practice, this means that the CSS will refer to the elements, not by name but by applying a CSS selector rule based on the value of a HTML attribute.
Remember the structure of our RDFa example:
<div vocab="http://schema.org/" typeof="http://schema.org/ItemList">
<div property="mainEntityOfPage" typeof="http://schema.org/CreativeWork">
<h1 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h1>
[...]
</div>
<div property="itemListElement" typeof="http://schema.org/ListItem">
<div property="item" typeof="http://schema.org/Product">
<h2 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h2>
[...]
<div>
<div>
<div>
Assuming that a context document will be contained in a div with the attribute vocab="http://schema.org/", we can use this to manipulate the aspect of the rectangle containing the OWS Context document using CSS selectors. In this case we are enclosing the OWS Context information in a 400px box that is grey with a green border.
[vocab="http://schema.org/"] {
background-color: lightgrey;
width: 400px;
border: 3px solid green;
padding: 5px;
margin: 5px;
word-wrap: break-word;
display: inline-block;
}
We can change all elements and attributes to present an "Arial" font by pointing to them with the right CSS selector that only mentions the schema.org semantics.
[property=mainEntityOfPage] {
font-family: Arial;
}
We can change the style of a particular attribute by pointing to it (in this case to change the color). Also note that we are only mentioning the schema.org semantics in tne CSS selector rule.
[property=itemListElement] > [property=item] > [property=name]{
color: green;
}
With these patterns we can address any element and change its aspect and make the document more readable.
8.2. Example that uses CSS with the RDFa encoding
This subsection presents and example of the use a CSS style sheet to change the presentation of a OWS context document and make it appear as a widget in an HTML page.
b {
color: gray;
}
[vocab="http://schema.org/"] {
background-color: lightgrey;
width: 400px;
border: 3px solid green;
padding: 5px;
margin: 5px;
word-wrap: break-word;
display: inline-block;
}
[property=mainEntityOfPage] {
font-family: Arial;
}
[property=mainEntityOfPage] > [property=name] {
color: blue;
}
[property=itemListElement] > [property=item] > [property=name]{
color: green;
}
This is the result of applying the CSS styles to RDFa version of the example presented in the previous Section.
Note
|
Inline CSS vs External CSS
To make the examples easier to understand, we as using inline CSS. It could be even more useful to use external CSS reference to be able to share the same CSS collection with several OWS Context documents. |
9. Adding JavaScript events to the RDFa encoding
This Section presents an example that illustrates how to use JavaScript to create some behaviours in Schema.org encoded OWS Context documents. A behavior is a dynamic reaction to a user action on an part of a HTML page. For example, we can associate a behavior to an area of a page, that shows more text we the user clicks or hovers above it with the mouse and hides it again when the mouse is removed from the area. In HTML, behaviours are commonly implemented as JavaScript event functions associated to HTML DOM elements.
In the same way we did with the previous seccion, an important detail here is that we can use the HTML document annotations with schema.org vocabularies (in this case we will use RDFa annotations, but Microdata annotations will serve the same purpose) as the mechanism to refer to the individual elements and attributes that form the OWS Context document metadata entries. By doing so, we avoid the need to add an id to the HTML tags or to reference the entries in a different way depending on the type of HTML tag that was used to make the representation (div, span…).
Remember the structure of our previous RDFa example:
<div vocab="http://schema.org/" typeof="http://schema.org/ItemList">
<div property="mainEntityOfPage" typeof="http://schema.org/CreativeWork">
<h1 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h1>
[...]
</div>
<div property="itemListElement" typeof="http://schema.org/ListItem">
<div property="item" typeof="http://schema.org/Product">
<h2 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h2>
[...]
<div>
<div>
<div>
Fortunately, we can use the same CSS selectors that were presented and exercised in the previous Section (Adding CSS to the RDFa encoding) in JavaScript using the querySelectorAll() method. This method of document returns an array of HTML objects that conforms with the the CSS selector.
The following example selects a division named as more_information, that is inside the general metadata of the OWS Context, and makes it visible or invisible.
function MoreInformation(visible)
{
var span_target=document.querySelectorAll("[property=mainEntityOfPage] > [name=more_information]")[0];
if (visible)
span_target.style.display="block";
else
span_target.style.display="none";
return false;
}
This function is linked to onMouseOver and onMouseOut events for a "-more-" text.
<div property="mainEntityOfPage" typeof="http://schema.org/CreativeWork">
[...]
<a href="javascript:void()" onMouseOver="MoreInformation(true);" onMouseOut="MoreInformation(false);">- more -</a>
[...]
</div>
The following example selects a division with a name contained in the variable name that has a url for the WMS GetMap request, loads it in the "src" of an HTML <img> and makes it visible or invisible as needed.
function ShowImage(href, name)
{
var img_target=document.querySelectorAll("[name="+name+"]")[0];
img_target.src=href.text;
if (img_target.style.display=="none")
img_target.style.display="inline-block";
else
img_target.style.display="none";
return false;
}
9.1. Example that uses JavaScript with the RDFa encoding
This subsection presents the complete example that includes the fragments shown before and illustrates how we can use JavaScript to add the previously commented events and behaviors to a OWS context document elements and creates a widget in an HTML page.
function MoreInformation(visible)
{
var span_target=document.querySelectorAll("[property=mainEntityOfPage] > [name=more_information]")[0];
if (visible)
span_target.style.display="block";
else
span_target.style.display="none";
return false;
}
function MoreInformationItem(i_item, visible)
{
var span_target=document.querySelectorAll("[property=itemListElement] > [property=item] >
[name=more_information]")[i_item];
if (visible)
span_target.style.display="block";
else
span_target.style.display="none";
return false;
}
function ShowImage(href, name)
{
var img_target=document.querySelectorAll("[name="+name+"]")[0];
img_target.src=href.text;
if (img_target.style.display=="none")
img_target.style.display="inline-block";
else
img_target.style.display="none";
return false;
}
<div vocab="http://schema.org/" typeof="http://schema.org/ItemList">
<div property="mainEntityOfPage" typeof="http://schema.org/CreativeWork">
<span property="schemaVersion" content="http://www.opengis.net/spec/owc-atom/1.0/req/core"></span>
<span property="sameAs" content="http://www.opengis.net/owc/1.0/examples/WMS_scale"></span>
<h1 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h1>
<b>Description:</b> <span property="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/>
<a href="javascript:void()" onMouseOver="MoreInformation(true);" onMouseOut="MoreInformation(false);">- more -</a><br />
<span name="more_information" style="display: none;"><br/>
<b>Updated date:</b> <span property="dateModified" content="2012-11-04T17:26:23Z">2012/11/04 17:26:23</span>
<div property="author" typeof="http://schema.org/Person">
<b>Autor:</b> <span property="name" content="Joan Maso">Joan Maso</span>
</div>
<div property="publisher" typeof="http://schema.org/Organization">
<b>Publisher:</b> <span property="name" content="CREAF">CREAF</span>
</div>
<div property="associatedMedia" typeof="http://schema.org/MediaObject">
<b>Recommended screen size:</b>
<div property="width" typeof="http://schema.org/QuantitativeValue">
<b>width:</b> <span property="value" content="600">600</span>
<span property="valueReference" typeof="http://schema.org/QuantitativeValue">
<span property="name" content="mmPerPixel"></span>
<span property="value" content="0.28"></span>
</span>
</div>
<div property="height" typeof="http://schema.org/QuantitativeValue">
<b>height:</b> <span property="value" content="400">400</span><br/>
<span property="valueReference" typeof="http://schema.org/QuantitativeValue">
<span property="name" content="mmPerPixel"></span>
<b>mm per pixel:</b> <span property="value" content="0.28">0.28</span>
</span>
</div>
<b>Creator application:</b> <span property="name" content="MiraMon">MiraMon</span>
(<span property="url" content="http://www.creaf.uab.cat/MiraMon">http://www.creaf.uab.cat/MiraMon</span>)
</div>
<div property="copyrightHolder" typeof="http://schema.org/Organization">
<b>Rights owner:</b> <span property="name" content="ICGC">ICGC</span>
</div>
<div property="contentLocation" typeof="http://schema.org/Place">
<div property="geo" typeof="http://schema.org/GeoShape">
<b>Bbox location:</b> <span property="box" content="414475,4567125 451575,4588025">414475,4567125 451575,4588025</span>
</div>
<div property="additionalProperty" typeof="http://schema.org/PropertyValue">
<span property="name" content="timeIntervalOfInterest"></span>
<b>Temporal span:</b> <span property="value" content="2012-01-01T00:00:00Z, 2012-06-01T00:00:00Z">2012-01-01/2012-06-01</span>
</div>
</div>
<b>Keywords:</b> <span property="keywords" content="WMS">WMS</span>
</span>
</div>
<div property="itemListElement" typeof="http://schema.org/ListItem">
<div property="item" typeof="http://schema.org/Product">
<h2 property="name">Ortophoto of Barcelona 1:5 000 [ICGC]</h2>
<span property="productID" content="http://shagrat.icc.es/lizardtech/iserv/ows/orto5m"></span>
<b>Description:</b> <span property="description">Window of the Ortophoto of Catalonia (Barcelona region) 1:5 000 [ICGC]</span><br/> <a href="javascript:void()" onMouseOver="MoreInformationItem(0, true);" onMouseOut="MoreInformationItem(0, false);">- more -</a><br />
<span name="more_information" style="display: none;">
<span property="image" content="http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1& REQUEST=GetMap&SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025& WIDTH=60&HEIGHT=40&LAYERS=orto5m& FORMAT=image/jpeg&STYLES="><img src="http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1& REQUEST=GetMap&SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025& WIDTH=60&HEIGHT=40&LAYERS=orto5m& FORMAT=image/jpeg&STYLES="></span><br/>
<b>Updated date:</b> <span property="releaseDate">2012-11-01T00:00:00Z</span>
<div property="manufacturer" typeof="http://schema.org/Organization">
<b>Author:</b> <span property="name">ICGC</span>
(<span property="email">icgc@icgc.cat</span>)
</div>
<div property="brand" typeof="http://schema.org/Organization">
<b>Publisher:</b> <span property="name">CREAF</span>
</div>
<div property="additionalProperty" typeof="http://schema.org/PropertyValue">
<span property="name" content="box"></span>
<b>BBox:</b> <span property="value">414475,4567125 451575,4588025</span>
</div>
<div property="additionalProperty" typeof="http://schema.org/PropertyValue">
<span property="name" content="ScaleDenominator"></span>
<b>Scales:</b> 1/<span property="maxValue">25000</span> -
1/<span property="minValue">2500</span>
</div>
<b>Abstract:</b> <span property="alternateName">Barcelona Ortophoto image 1:5 000 produced by the Institut Cartografic de Catalunya (the more recent one)</span>
</span>
<div property="offers" typeof="http://schema.org/Offer">
<h3>WMS (<span property="additionalType">http://www.opengis.net/spec/owc-atom/1.0/req/wms</span>)</h3>
<div property="potentialAction" typeof="http://schema.org/Action">
<div property="target" typeof="http://schema.org/EntryPoint">
<h4>GetCapabilties</h4>
<span property="additionalType" content="http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetCapabilities"></span>
<span property="httpMethod" content="GET"></span>
<span property="contentType" content="application/xml"></span>
<b>URL:</b> <a href="http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" property="url" target="_blank">http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities</a>
</div>
</div>
<div property="potentialAction" typeof="http://schema.org/Action">
<div property="target" typeof="http://schema.org/EntryPoint">
<h4>GetMap</h4>
<span property="additionalType" conntent="http://www.opengis.net/spec/owc-atom/1.0/req/wms/GetMap"></span>
<span property="httpMethod" content="GET"></span>
<span property="contentType" content="image/jpeg"></span>
<b>URL:</b> <a property="url" a href="javascript:void()" onClick='ShowImage(this, "wms-img-0");'>http://shagrat.icc.es/lizardtech/iserv/ows?SERVICE=WMS& VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:23031&BBOX=414475,4567125,451575,4588025& WIDTH=600&HEIGHT=400&LAYERS=orto5m& FORMAT=image/jpeg&STYLES=</a><br/>
</div>
</div>
<span property="price" content="0.00"></span>
</div>
</div>
</div>
</div>
<img name="wms-img-0" style="display:none">
Note
|
Inline JavaScript vs External JavaScript
To make the examples easier to understand, we are using inline JavaScript. It could be even more useful to use external JavaScript reference to be able to share the same JavaScript functions in several OWS Context documents. |
Appendix A: Revision History
Date | Release | Editor | Primary clauses modified | Descriptions |
---|---|---|---|---|
Sep 20, 2016 |
Joan Maso |
.1 |
all |
first full version |
Nov 2, 2016 |
Joan Maso |
1.0 |
all |
comments integrated; text finalized and ready for TC review. |
Dec 7, 2016 |
Joan Maso |
r1 |
all |
format of the tables improved and made readable. Editorial changes improved the text. |
Appendix B: Bibliography
-
[OGC 14-009r1] OGC® Testbed-10 Rules for JSON and GeoJSON Adoption: Focus on OWS-Context
-
[OGC 15-053] OGC® Testbed-11 Implementing JSON/GeoJSON in an OGC Standard ER
-
[OGC 12-084r2] OGC® OWS Context Atom Encoding Standard
-
[OGC 14-055r2] OGC® OWS Context GeoJSON Encoding Standard
-
[RFC7946] IETF RFC7946: The GeoJSON Format