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.eclipse.rdf4j.model.IRI;
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 IRI Listing = createClass("Listing");
43      public final IRI Lister  = createClass("Lister" ); // isa FOAF.Person
44      public final IRI Item    = createClass("Item"   ); // isa ?
45  
46      // Properties.
47      public final IRI action = createProperty("action");
48      public final IRI lister = createProperty("lister"); // ranges over Lister
49      public final IRI item   = createProperty("item"  );
50  
51      public final IRI sell     = createClass("sell"    );
52      public final IRI rent     = createClass("rent"    );
53      public final IRI trade    = createClass("trade"   );
54      public final IRI meet     = createClass("meet"    );
55      public final IRI announce = createClass("announce");
56      public final IRI offer    = createClass("offer"   );
57      public final IRI wanted   = createClass("wanted"  );
58      public final IRI event    = createClass("event"   );
59      public final IRI service  = createClass("service" );
60  
61      public final IRI tel       = VCard.getInstance().tel;
62      public final IRI dtlisted  = createProperty("dtlisted" );
63      public final IRI dtexpired = createProperty("dtexpired");
64      public final IRI price     = createProperty("price"    );
65  
66      public final IRI description = createProperty("description");
67      public final IRI summary     = createProperty("summary"    );
68      public final IRI permalink   = createProperty("permalink"  );
69  
70      public final IRI region          = VCard.getInstance().region;
71      public final IRI postOfficeBox   = VCard.getInstance().post_office_box;
72      public final IRI locality        = VCard.getInstance().locality;
73      public final IRI extendedAddress = VCard.getInstance().extended_address;
74      public final IRI streetAddress   = VCard.getInstance().street_address;
75      public final IRI postalCode      = VCard.getInstance().postal_code;
76      public final IRI countryName     = VCard.getInstance().country_name;
77  
78      public final IRI listerUrl  = createProperty("listerUrl" );
79      public final IRI listerName = createProperty("listerName");
80      public final IRI itemName   = createProperty("itemName"  );
81      public final IRI itemUrl    = createProperty("itemUrl"   );
82      public final IRI itemPhoto  = createProperty("itemPhoto" );
83      public final IRI listerOrg  = createProperty("listerOrg" );
84      public final IRI listerLogo = createProperty("listerLogo");
85  
86      private IRI createProperty(String localName) {
87          return createProperty(NS, localName);
88      }
89  
90      private IRI createClass(String localName) {
91          return createClass(NS, localName);
92      }
93  
94      private HListing(){
95          super(NS);
96      }
97  
98  }