schema.ui.ttl 17.7 KB
# baseURI: http://topbraid.org/examples/schema.ui
# imports: http://appschema.org
# imports: http://schema.rdfs.org/all.rdf
# imports: http://uispin.org/charts

@prefix app:     <http://appschema.org/> .
@prefix arg:     <http://spinrdf.org/arg#> .
@prefix charts:  <http://uispin.org/charts#> .
@prefix fn:      <http://www.w3.org/2005/xpath-functions#> .
@prefix html:    <http://uispin.org/html#> .
@prefix let:     <http://uispin.org/let#> .
@prefix letrs:   <http://uispin.org/letrs#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema.ui:  <http://topbraid.org/examples/schema.ui#> .
@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix ui:      <http://uispin.org/ui#> .
@prefix vocab.sindice.net:  <http://vocab.sindice.net/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

app:Elements
      rdfs:subClassOf charts:MapElements ;
      ui:headIncludes
              [ rdf:type ui:group ;
                let:key [ rdf:type charts:googleMapsAPIKey
                        ] ;
                ui:child
                        [ rdf:type ui:if ;
                          ui:child
                                  [ rdf:type html:Script ;
                                    html:src
                                            [ rdf:type fn:concat ;
                                              sp:arg1 "http://maps.google.com/maps?file=api&v=2&sensor=false&key=" ;
                                              sp:arg2 [ sp:varName "key"^^xsd:string
                                                      ]
                                            ] ;
                                    ui:childIndex 0
                                  ] ;
                          ui:childIndex 0 ;
                          ui:condition
                                  [ rdf:type sp:bound ;
                                    sp:arg1 [ sp:varName "key"^^xsd:string
                                            ]
                                  ]
                        ]
              ] .

<http://schema.org/EducationEvent>
      ui:instanceView
              [ rdf:type ui:group ;
                <http://uispin.org/default#subject>
                        spin:_this ;
                ui:child
                        [ rdf:type app:Object ;
                          arg:label "Event Name"^^xsd:string ;
                          arg:predicate rdfs:label ;
                          ui:childIndex 0
                        ] ;
                ui:child
                        [ rdf:type app:ColumnLayout ;
                          arg:colWidths "250px,250px"^^xsd:string ;
                          ui:child
                                  [ rdf:type app:Object ;
                                    arg:predicate <http://schema.org/startDate> ;
                                    ui:childIndex 0
                                  ] ;
                          ui:child
                                  [ rdf:type app:Object ;
                                    arg:predicate <http://schema.org/endDate> ;
                                    ui:childIndex 1
                                  ] ;
                          ui:childIndex 1
                        ] ;
                ui:child
                        [ rdf:type app:Object ;
                          arg:predicate <http://schema.org/location> ;
                          ui:childIndex 2
                        ]
              ] .

<http://schema.org/Place>
      ui:instanceView
              [ rdf:type ui:group ;
                let:address
                        [ rdf:type spl:object ;
                          sp:arg1 spin:_this ;
                          sp:arg2 <http://schema.org/address>
                        ] ;
                ui:child
                        [ rdf:type ui:if ;
                          ui:child
                                  [ rdf:type <http://topbraid.org/examples/schema.ui#AddressLabel> ;
                                    arg:address
                                            [ sp:varName "address"^^xsd:string
                                            ] ;
                                    ui:childIndex 0
                                  ] ;
                          ui:childIndex 0 ;
                          ui:condition
                                  [ rdf:type sp:bound ;
                                    sp:arg1 [ sp:varName "address"^^xsd:string
                                            ]
                                  ]
                        ] ;
                ui:child
                        [ rdf:type ui:else ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 0 ;
                                    ui:text [ rdf:type ui:label ;
                                              sp:arg1 spin:_this
                                            ]
                                  ] ;
                          ui:childIndex 1
                        ] ;
                ui:id   "label"^^xsd:string
              ] .

<http://schema.org/PostalAddress>
      ui:instanceView
              [ rdf:type <http://topbraid.org/examples/schema.ui#AddressLabel> ;
                arg:address spin:_this ;
                ui:id   "label"^^xsd:string
              ] .

<http://schema.org/Thing>
      ui:instanceView
              [ rdf:type ui:group ;
                let:image
                        [ rdf:type spl:object ;
                          sp:arg1 spin:_this ;
                          sp:arg2 <http://schema.org/image>
                        ] ;
                ui:child
                        [ rdf:type ui:if ;
                          ui:child
                                  [ rdf:type html:Table ;
                                    html:style "border-spacing: 0px;"^^xsd:string ;
                                    ui:child
                                            [ rdf:type html:Tr ;
                                              ui:child
                                                      [ rdf:type html:Td ;
                                                        ui:child
                                                                [ rdf:type html:Img ;
                                                                  html:src
                                                                          [ sp:varName "image"^^xsd:string
                                                                          ] ;
                                                                  html:style "border: 1px solid black; max-width:32px; max-height:32px"^^xsd:string ;
                                                                  ui:childIndex 0
                                                                ] ;
                                                        ui:childIndex 0
                                                      ] ;
                                              ui:child
                                                      [ rdf:type html:Td ;
                                                        ui:child
                                                                [ rdf:type ui:TextNode ;
                                                                  ui:childIndex 0 ;
                                                                  ui:text [ rdf:type ui:label ;
                                                                            sp:arg1 spin:_this
                                                                          ]
                                                                ] ;
                                                        ui:childIndex 1
                                                      ] ;
                                              ui:childIndex 0
                                            ] ;
                                    ui:childIndex 0
                                  ] ;
                          ui:childIndex 0 ;
                          ui:condition
                                  [ rdf:type sp:bound ;
                                    sp:arg1 [ sp:varName "image"^^xsd:string
                                            ]
                                  ]
                        ] ;
                ui:child
                        [ rdf:type ui:else ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 0 ;
                                    ui:text [ rdf:type ui:label ;
                                              sp:arg1 spin:_this
                                            ]
                                  ] ;
                          ui:childIndex 1
                        ] ;
                ui:id   "label"^^xsd:string
              ] .

arg:address
      rdf:type rdf:Property ;
      rdfs:label "address"^^xsd:string ;
      rdfs:subPropertyOf sp:arg .

<http://topbraid.org/examples/schema.ui>
      rdf:type owl:Ontology ;
      owl:imports <http://appschema.org> , <http://schema.rdfs.org/all.rdf> , <http://uispin.org/charts> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

<http://topbraid.org/examples/schema.ui#AddressLabel>
      rdf:type ui:NodeClass ;
      rdfs:label "Address label"^^xsd:string ;
      rdfs:subClassOf <http://topbraid.org/examples/schema.ui#Elements> ;
      spin:constraint
              [ rdf:type spl:Argument ;
                rdfs:comment "The PostalAddress to display."^^xsd:string ;
                spl:predicate arg:address ;
                spl:valueType <http://schema.org/PostalAddress>
              ] ;
      ui:prototype
              [ rdf:type html:Div ;
                let:code
                        [ rdf:type spl:object ;
                          sp:arg1 [ sp:varName "address"^^xsd:string
                                  ] ;
                          sp:arg2 <http://schema.org/postalCode>
                        ] ;
                let:country
                        [ rdf:type spl:object ;
                          sp:arg1 [ sp:varName "address"^^xsd:string
                                  ] ;
                          sp:arg2 <http://schema.org/addressCountry>
                        ] ;
                let:locality
                        [ rdf:type spl:object ;
                          sp:arg1 [ sp:varName "address"^^xsd:string
                                  ] ;
                          sp:arg2 <http://schema.org/addressLocality>
                        ] ;
                let:region
                        [ rdf:type spl:object ;
                          sp:arg1 [ sp:varName "address"^^xsd:string
                                  ] ;
                          sp:arg2 <http://schema.org/addressRegion>
                        ] ;
                let:street
                        [ rdf:type spl:object ;
                          sp:arg1 [ sp:varName "address"^^xsd:string
                                  ] ;
                          sp:arg2 <http://schema.org/streetAddress>
                        ] ;
                ui:child
                        [ rdf:type ui:if ;
                          ui:child
                                  [ rdf:type html:Div ;
                                    ui:child
                                            [ rdf:type ui:TextNode ;
                                              ui:childIndex 0 ;
                                              ui:text [ sp:varName "street"^^xsd:string
                                                      ]
                                            ] ;
                                    ui:childIndex 0
                                  ] ;
                          ui:childIndex 0 ;
                          ui:condition
                                  [ rdf:type sp:bound ;
                                    sp:arg1 [ sp:varName "street"^^xsd:string
                                            ]
                                  ]
                        ] ;
                ui:child
                        [ rdf:type html:Div ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 0 ;
                                    ui:text [ sp:varName "locality"^^xsd:string
                                            ]
                                  ] ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 1 ;
                                    ui:text ", "^^xsd:string
                                  ] ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 2 ;
                                    ui:text [ sp:varName "region"^^xsd:string
                                            ]
                                  ] ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 3 ;
                                    ui:text " "^^xsd:string
                                  ] ;
                          ui:child
                                  [ rdf:type ui:TextNode ;
                                    ui:childIndex 4 ;
                                    ui:text [ sp:varName "code"^^xsd:string
                                            ]
                                  ] ;
                          ui:childIndex 1
                        ] ;
                ui:child
                        [ rdf:type ui:if ;
                          ui:child
                                  [ rdf:type html:Div ;
                                    ui:child
                                            [ rdf:type ui:TextNode ;
                                              ui:childIndex 0 ;
                                              ui:text [ rdf:type ui:label ;
                                                        sp:arg1 [ sp:varName "country"^^xsd:string
                                                                ]
                                                      ]
                                            ] ;
                                    ui:childIndex 0
                                  ] ;
                          ui:childIndex 2 ;
                          ui:condition
                                  [ rdf:type sp:bound ;
                                    sp:arg1 [ sp:varName "country"^^xsd:string
                                            ]
                                  ]
                        ]
              ] .

<http://topbraid.org/examples/schema.ui#Elements>
      rdf:type ui:NodeClass ;
      rdfs:label "Elements"^^xsd:string ;
      rdfs:subClassOf ui:Element ;
      ui:abstract "true"^^xsd:boolean .

<http://topbraid.org/examples/schema.ui#MapViewer>
      rdf:type app:ObjectViewerClass ;
      rdfs:label "Map viewer"^^xsd:string ;
      rdfs:subClassOf app:ObjectViewer ;
      app:objectWidgetWeight
              [ rdf:type app:WeightedExpression ;
                app:expression
                        [ rdf:type sp:and ;
                          sp:arg1 [ rdf:type sp:not ;
                                    sp:arg1 [ rdf:type sp:isLiteral ;
                                              sp:arg1 [ sp:varName "node"^^xsd:string
                                                      ]
                                            ]
                                  ] ;
                          sp:arg2 [ rdf:type spl:instanceOf ;
                                    sp:arg1 [ sp:varName "node"^^xsd:string
                                            ] ;
                                    sp:arg2 <http://schema.org/GeoCoordinates>
                                  ]
                        ] ;
                app:weight 5
              ] ;
      ui:prototype
              [ rdf:type charts:Map ;
                charts:height 200 ;
                charts:width 320 ;
                ui:resultSet
                        [ rdf:type sp:Select ;
                          sp:resultVariables ([ sp:varName "lat"^^xsd:string
                                    ] [ sp:varName "long"^^xsd:string
                                    ] [ sp:varName "link"^^xsd:string
                                    ]) ;
                          sp:where ([ sp:object
                                              [ sp:varName "lat"^^xsd:string
                                              ] ;
                                      sp:predicate <http://schema.org/latitude> ;
                                      sp:subject
                                              [ sp:varName "node"^^xsd:string
                                              ]
                                    ] [ sp:object
                                              [ sp:varName "long"^^xsd:string
                                              ] ;
                                      sp:predicate <http://schema.org/longitude> ;
                                      sp:subject
                                              [ sp:varName "node"^^xsd:string
                                              ]
                                    ] [ rdf:type sp:Bind ;
                                      sp:expression
                                              [ sp:varName "node"^^xsd:string
                                              ] ;
                                      sp:variable
                                              [ sp:varName "link"^^xsd:string
                                              ]
                                    ])
                        ]
              ] .