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   * The <i>MS Excel</i> extractor vocabulary.
    24   *
    25   * @see org.apache.any23.plugin.officescraper.ExcelExtractor
    26   * @author Michele Mostarda (mostarda@fbk.eu)
    27   */
    28  public class Excel extends Vocabulary {
    29
    30      public static final String SHEET = "sheet";
    31      public static final String ROW   = "row";
    32      public static final String CELL  = "cell";
    33
    34      public static final String CONTAINS_SHEET = "containsSheet";
    35      public static final String CONTAINS_ROW   = "containsRow";
    36      public static final String CONTAINS_CELL  = "containsCell";
    37      public static final String CELL_VALUE     = "cellValue";
    38
    39
    40      public static final String SHEET_NAME = "sheetName";
    41      public static final String FIRST_ROW  = "firstRow";
    42      public static final String LAST_ROW   = "lastRow";
    43      public static final String FIRST_CELL = "firstCell";
    44      public static final String LAST_CELL  = "lastCell";
    45
    46      /**
    47       * This property links the identifier of a <i>document</i> to the identifier of a <i>sheet</i>.
    48       */
    49      public final IRI containsSheet = createProperty(CONTAINS_SHEET);
    50
    51      /**
    52       * This property links the identifier of a <i>sheet</i> to the identifier of a <i>row</i>.
    53       */
    54      public final IRI containsRow = createProperty(CONTAINS_ROW);
    55
    56      /**
    57       * This property links the identifier of a <i>row</i> to the identifier of a <i>cell</i>.
    58       */
    59      public final IRI containsCell = createProperty(CONTAINS_CELL);
    60
    61      /**
    62       * This property links the identifier of a <i>Sheet</i> to the name of the sheet.
    63       */
    64      public final IRI sheetName = createProperty(SHEET_NAME);
    65
    66      /**
    67       * This property links the identifier of a <i>Sheet</i> to the index of the first declared row.
    68       */
    69      public final IRI firstRow = createProperty(FIRST_ROW);
    70
    71      /**
    72       * This property links the identifier of a <i>Sheet</i> to the index of the last declared row.
    73       */
    74      public final IRI lastRow = createProperty(LAST_ROW);
    75
    76      /**
    77       * This property links the identifier of a <i>Row</i> to the index of the first declared cell.
    78       */
    79      public final IRI firstCell = createProperty(FIRST_CELL);
    80
    81      /**
    82       * This property links the identifier of a <i>Row</i> to the index of the last declared cell.
    83       */
    84      public final IRI lastCell = createProperty(LAST_CELL);
    85
    86      /**
    87       * This property links the identifier of a <i>cell</i> to the content of the cell.
    88       */
    89      public final IRI cellValue = createProperty(CELL_VALUE);
    90
    91
    92      /**
    93       * This resource identifies a <i>Sheet</i>.
    94       */
    95      public final IRI sheet = createResource(SHEET);
    96
    97      /**
    98       * This resource identifies a <i>row</i>.
    99       */
    100     public final IRI row = createResource(ROW);
    101
    102     /**
    103      * This resource identifies a <i>cell</i>.
    104      */
    105     public final IRI cell = createResource(CELL);
    106
    107     /**
    108      * The namespace of the vocabulary as a string.
    109      */
    110     public static final String NS = "http://any23.apache.org/excel/";
    111
    112     private static final class InstanceHolder {
    113         private static final Excelhtml#Excel">Excel instance = new Excel();
    114     }
    115
    116     public static Excel getInstance() {
    117         return InstanceHolder.instance;
    118     }
    119
    120     public IRI createResource(String localName) {
    121         return createProperty(NS, localName);
    122     }
    123
    124     /**
    125      *
    126      * @param localName
    127      * @return the new IRI instance.
    128      */
    129     public IRI createProperty(String localName) {
    130         return createProperty(NS, localName);
    131     }
    132
    133     private Excel() {
    134         super(NS);
    135     }
    136
    137
    138 }