View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *  http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.any23.vocab;
19  
20  import org.openrdf.model.URI;
21  
22  /**
23   * Class modeling the <a href="http://microformats.org/wiki/hlisting-proposal">hListing</a> vocabulary.
24   *
25   * @author Davide Palmisano (dpalmisano@gmail.com)
26   * 
27   */
28  public class HLISTING extends Vocabulary {
29  
30      public static final String NS = "http://sindice.com/hlisting/0.1/";
31  
32      private static HLISTING instance;
33  
34      public static HLISTING getInstance() {
35          if(instance == null) {
36              instance = new HLISTING();
37          }
38          return instance;
39      }
40  
41      // Resources.
42      public final URI Listing = createClass("Listing");
43      public final URI Lister  = createClass("Lister" ); // isa FOAF.Person
44      public final URI Item    = createClass("Item"   ); // isa ?
45  
46      // Properties.
47      public final URI action = createProperty("action");
48      public final URI lister = createProperty("lister"); // ranges over Lister
49      public final URI item   = createProperty("item"  );
50  
51      public final URI sell     = createClass("sell"    );
52      public final URI rent     = createClass("rent"    );
53      public final URI trade    = createClass("trade"   );
54      public final URI meet     = createClass("meet"    );
55      public final URI announce = createClass("announce");
56      public final URI offer    = createClass("offer"   );
57      public final URI wanted   = createClass("wanted"  );
58      public final URI event    = createClass("event"   );
59      public final URI service  = createClass("service" );
60  
61      public final URI tel       = VCARD.getInstance().tel;
62      public final URI dtlisted  = createProperty("dtlisted" );
63      public final URI dtexpired = createProperty("dtexpired");
64      public final URI price     = createProperty("price"    );
65  
66      public final URI description = createProperty("description");
67      public final URI summary     = createProperty("summary"    );
68      public final URI permalink   = createProperty("permalink"  );
69  
70      public final URI region          = VCARD.getInstance().region;
71      public final URI postOfficeBox   = VCARD.getInstance().post_office_box;
72      public final URI locality        = VCARD.getInstance().locality;
73      public final URI extendedAddress = VCARD.getInstance().extended_address;
74      public final URI streetAddress   = VCARD.getInstance().street_address;
75      public final URI postalCode      = VCARD.getInstance().postal_code;
76      public final URI countryName     = VCARD.getInstance().country_name;
77  
78      public final URI listerUrl  = createProperty("listerUrl" );
79      public final URI listerName = createProperty("listerName");
80      public final URI itemName   = createProperty("itemName"  );
81      public final URI itemUrl    = createProperty("itemUrl"   );
82      public final URI itemPhoto  = createProperty("itemPhoto" );
83      public final URI listerOrg  = createProperty("listerOrg" );
84      public final URI listerLogo = createProperty("listerLogo");
85  
86      private URI createProperty(String localName) {
87          return createProperty(NS, localName);
88      }
89  
90      private URI createClass(String localName) {
91          return createClass(NS, localName);
92      }
93  
94      private HLISTING(){
95          super(NS);
96      }
97  
98  }