Warning: This tool or project is no longer maintained and kept available only for archival purposes. Since GoodRelations and schema.org have evolved significantly in the past years, the current status available on this page is unlikely to function as expected. We take no responsibility for any damage caused by the use of this outdated work, to the extent legally possible.

Due to a lack of resources, we are unable to provide support for this project outside of consulting projects or sponsored research. Please contact us if you can contribute resources to update and enhance these resources.

GoodRelations - The Web Vocabulary for E-Commerce

This is the archive of the goodrelations dicussion list

GoodRelations is a standardized vocabulary for product, price, and company data that can (1) be embedded into existing static and dynamic Web pages and that (2) can be processed by other computers. This increases the visibility of your products and services in the latest generation of search engines, recommender systems, and other novel applications.

[goodrelations] gr:displayPosition help

Martin Hepp martin.hepp at ebusiness-unibw.org
Tue May 8 01:02:22 CEST 2012

Hi Radu,

On May 7, 2012, at 12:50 PM, Radu Silaghi wrote:

> Hello all,
> Has anybody a use case for gr:displayPosition at http://www.heppnetz.de/ontologies/goodrelations/v1.html#displayPosition ?
> It is a new introduction and not officially documented yet, and I am new to GR and overwelmed at this.
> thanks,
> Radu

You can use this annotation property for indicating a preferred order for the rendering of various types of data. 
A typical example is defining an order for product attributes in a domain extension for GoodRelations.

For instance, if you follow the recipe at


and define new product properties like

# Properties
    a owl:ObjectProperty ;
    rdfs:domain default:TVSet ;
    rdfs:range gr:QuantitativeValueInteger ;
    rdfs:subPropertyOf gr:quantitativeProductOrServiceProperty .
    a owl:DatatypeProperty ;
    rdfs:domain default:TVSet ;
    rdfs:range xsd:boolean ;
    rdfs:subPropertyOf gr:datatypeProductOrServiceProperty .

then you may want to say that the operating voltage should typically be shown first by a client by adding the statements

foo:hasOperatingVoltage gr:displayPosition "1"^^xsd:integer .
foo:hasVideoInput gr:displayPosition "2"^^xsd:integer .

A client should (but does not have to) order property values by the ordering relation of indicated by gr:displayPosition, if present.

Note that this simple mechanism does allow only a single, global order at the vocabulary level.

The initial reason to introduce gr:displayPosition was that you often need to create a tabular list of opening hours per day of the week, which is difficult only on the basis of gr:hasNext and gr:hasPrevious links between the days of the week. Thus, all days of the week in GoodRelations have a gr:displayPosition property with Mo = 1, Tue = 2, Wed = 3, ..., Sun = 7.

# Example in Turtle syntax

gr:Monday a gr:DayOfWeek;
	gr:displayPosition 1;
	rdfs:label "Monday (day of week)"@en.

gr:Tuesday a gr:DayOfWeek;
	gr:displayPosition 2;
	rdfs:label "Tuesday (day of week)"@en.


This allows simple SPARQL queries like

{ ?day a gr:DayOfWeek . 
  ?day gr:displayPosition ?pos. } 

which will return this nicely ordered list

day							pos
http://purl.org/goodrelations/v1#Monday			1
http://purl.org/goodrelations/v1#Tuesday		2
http://purl.org/goodrelations/v1#Wednesday		3
http://purl.org/goodrelations/v1#Thursday		4
http://purl.org/goodrelations/v1#Friday			5
http://purl.org/goodrelations/v1#Saturday		6
http://purl.org/goodrelations/v1#Sunday			7
http://purl.org/goodrelations/v1#PublicHolidays		8

If you use nested SPARQL queries, you can nicely create an ordered table of opening hours on the basis of gr:displayPosition.

Hope that helps.

Best wishes

Martin Hepp

martin hepp
e-business & web science research group
universitaet der bundeswehr muenchen

e-mail:  hepp at ebusiness-unibw.org
phone:   +49-(0)89-6004-4217
fax:     +49-(0)89-6004-4620
www:     http://www.unibw.de/ebusiness/ (group)
         http://www.heppnetz.de/ (personal)
skype:   mfhepp 
twitter: mfhepp

Check out GoodRelations for E-Commerce on the Web of Linked Data!
* Project Main Page: http://purl.org/goodrelations/

More information about the goodrelations mailing list