The information in an OSLC resource is composed of RDF triples, defining the values of properties. Triples whose object is the URI of another resource are often called links. When presenting a link to a human user, it is common to want to include information about the other resource referenced by the URI of the link. This information might be included in the rendering of the page of the current resource, or on conventional PCs that have a mouse as an input device it might appear in a pop-up window when the mouse is over the link. [Obviously, the pop-up window technique does not apply for touch-screen devices like smart-phones and tablets, or at least the pop-up has to be triggered by a different gesture.] OSLC defines a protocol that makes it convenient for an application to obtain a small amount of information about the resource that is the target of a link for the purposes of this sort of display.
UI preview consists solely of the definition of a new media type, and a representation format for that media type. The new media type is
application/x-oslc-compact+xml. When a
GET is performed on a resource with this media type, a conforming implementation is expected to return a small amount of information about the resource suitable for display purposes. This information is in RDF format and includes the following properties:
GETto retrieve the icon.
GETto retrieve the HTML.
OSLC requires that this information be returned in RDF/XML format - other RDF or non-RDF representations are not allowed.
<?xml version="1.0" encoding="UTF-8" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc="http://open-services.net/ns/core#"> <oslc:Compact rdf:about="http://example.com/bugs/12345"> <dcterms:title> 12345: <s>Null pointer exception during startup</s> </dcterms:title> <oslc:shortTitle> 12345 </oslc:shortTitle> <oslc:icon rdf:resource="http://example.com/icons/defect.jpg" /> <oslc:smallPreview> <oslc:Preview> <oslc:document rdf:resource="http://example.com/bugs/12345?hover=small" /> </oslc:Preview> </oslc:smallPreview> <oslc:largePreview> <oslc:Preview> <oslc:document rdf:resource="http://example.com/bugs/12345?hover=large" /> <oslc:hintWidth> 60em </oslc:hintWidth> <oslc:hintHeight> 20em </oslc:hintHeight> </oslc:Preview> </oslc:largePreview> </oslc:Compact> </rdf:RDF>
Learn more about UI Preview in the OSLC Core specification