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.
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 http://wiki.goodrelations-vocabulary.org/Documentation/Extensions and define new product properties like # Properties foo:hasOperatingVoltage a owl:ObjectProperty ; rdfs:domain default:TVSet ; rdfs:range gr:QuantitativeValueInteger ; rdfs:subPropertyOf gr:quantitativeProductOrServiceProperty . foo:hasVideoInput 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. etc. This allows simple SPARQL queries like SELECT DISTINCT(?day), ?pos WHERE { ?day a gr:DayOfWeek . ?day gr:displayPosition ?pos. } ORDER BY ?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/