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   * This vocabulary models the structure of a <i>CSV</i> file
24   * according the <a href="http://www.ietf.org/rfc/rfc4180.txt">RFC 4180</a>.
25   *
26   * @author Davide Palmisano (dpalmisano@gmail.com)
27   */
28  public class CSV extends Vocabulary {
29  
30      public static final String ROW = "row";
31  
32      public static final String ROW_POSITION= "rowPosition";
33  
34      public static final String NUMBER_OF_ROWS = "numberOfRows";
35  
36      public static final String NUMBER_OF_COLUMNS = "numberOfColumns";
37  
38      public static final String COLUMN_POSITION= "columnPosition";
39  
40      public static final String ROW_TYPE = "Row";
41  
42      /**
43       * This property links the identifier of a <i>CSV</i> to an entity representing
44       * a row.
45       */
46      public final IRI row = createProperty(ROW);
47  
48      /**
49       * This property expresses the index of a row in a <i>CSV</i> file.
50       */
51      public final IRI rowPosition = createProperty(ROW_POSITION);
52  
53      /**
54       * This property expresses the number of rows in a <i>CSV</i> file.
55       */
56      public final IRI numberOfRows = createProperty(NUMBER_OF_ROWS);
57  
58      /**
59       * This property expresses the number of columns in a <i>CSV</i> file.
60       */
61      public final IRI numberOfColumns = createProperty(NUMBER_OF_COLUMNS);
62  
63      /**
64       * This resource identifies a <i>Row</i>.
65       */
66      public final IRI rowType = createResource(ROW_TYPE);
67  
68      /**
69       * This property expresses the index of a column in a <i>CSV</i> file.
70       */
71      public final IRI columnPosition = createProperty(COLUMN_POSITION);
72  
73      /**
74       * The namespace of the vocabulary as a string.
75       */
76      public static final String NS = "http://tools.ietf.org/html/rfc4180";
77  
78      private static CSV instance;
79  
80      private CSV() {
81        super(NS);
82      }
83  
84      public static CSV getInstance() {
85          if (instance == null) {
86              instance = new CSV();
87          }
88          return instance;
89      }
90  
91      public IRI createResource(String localName) {
92          return createProperty(NS, localName);
93      }
94  
95      /**
96       *
97       * @param localName name to assign to namespace.
98       * @return the new URI instance.
99       */
100     public IRI createProperty(String localName) {
101         return createProperty(NS, localName);
102     }
103 
104 }