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   * This class models an internal <i>Sindice</i> Vocabulary to describe
24   * resource domains and Microformat nesting relationships.
25   * See the <a href="http://developers.any23.org/extraction.html">Any23 extraction notes</a>.
26   *
27   * @author Davide Palmisano (dpalmisano@gmail.com)
28   * @author Michele Mostarda (michele.mostarda@gmail.com)
29   */
30  public class SINDICE extends Vocabulary {
31  
32      public static final String DOMAIN = "domain";
33  
34      public static final String NESTING = "nesting";
35  
36      public static final String NESTING_ORIGINAL = "nesting_original";
37  
38      public static final String NESTING_STRUCTURED = "nesting_structured";
39  
40      public static final String SIZE = "size";
41  
42      public static final String DATE = "date";
43  
44      /**
45       * The namespace of the vocabulary as a string.
46       */
47      public static final String NS = "http://vocab.sindice.net/any23#";
48  
49      private static SINDICE instance;
50  
51      public static SINDICE getInstance() {
52          if(instance == null) {
53              instance = new SINDICE();
54          }
55          return instance;
56      }
57  
58      /**
59       * The namespace of the vocabulary as a URI.
60       */
61      public final URI NAMESPACE = createURI(NS);
62  
63      /**
64       * This property expresses the DNS domain of the resource on which
65       * it is applied. It is intended to be used to keep track of the domain provenance
66       * of each resource.
67       */
68      public final URI domain = createProperty(DOMAIN);
69  
70      /**
71       * This property links a resource with a <i>blank node</i> that represents
72       * a nested <i>Microformat</i> node.
73       */
74      public final URI nesting = createProperty(NESTING);
75  
76      /**
77       * This property is used to keep track of the original nested <i>RDF property</i>.
78       */
79      public final URI nesting_original = createProperty(NESTING_ORIGINAL);
80  
81      /**
82       * This property links the resource with a <i>node</i> representing the nested <i>Microformat</i>
83       * 
84       */
85      public final URI nesting_structured = createProperty(NESTING_STRUCTURED);
86  
87      /**
88       * Size meta property indicating the number of triples within the returned dataset.
89       */
90      public final URI size = createProperty(SIZE);
91  
92      /**
93       * Date meta property indicating the data generation time.
94       */
95      public final URI date = createProperty(DATE);
96  
97  
98      private URI createClass(String localName) {
99          return createClass(NS, localName);
100     }
101 
102     private URI createProperty(String localName) {
103         return createProperty(NS, localName);
104     }
105 
106     private SINDICE(){
107         super(NS);
108     }
109 
110 }