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 <a href="http://ogp.me/#type_music">Open Graph Protocol Music Type</a> vocabulary.
    24   *
    25   */
    26  public class OGPMusic extends Vocabulary {
    27
    28      private OGPMusic() {
    29          super(NS);
    30      }
    31
    32      public static final String NS = "http://ogp.me/ns/music#";
    33
    34      /* BEGIN: http://ogp.me/#type_music.song */
    35
    36      /** The song's length in seconds. */
    37      public static final String MUSIC__DURATION = "music:duration";
    38
    39      /** The album this song is from. */
    40      public static final String MUSIC__ALBUM = "music:album";
    41
    42      /** Which disc of the album this song is on. */
    43      public static final String MUSIC__ALBUM_DISC = "music:album:disc";
    44
    45      /** Which disc of the album this song is on. */
    46      public static final String MUSIC__ALBUM_TRACK = "music:album:track";
    47
    48      /** Which disc of the album this song is on. */
    49      public static final String MUSIC__MUSICIAN = "music:musician";
    50
    51      /* END: http://ogp.me/#type_music.song */
    52
    53      /* BEGIN: http://ogp.me/#type_music.album */
    54
    55      /** The song on this album. */
    56      public static final String MUSIC__SONG = "music:song";
    57
    58      /** The same as music:album:disc but in reverse. */
    59      public static final String MUSIC__SONG_DISC = "music:song:disc";
    60
    61      /** The same as music:album:track but in reverse. */
    62      public static final String MUSIC__SONG_TRACK = "music:song:track";
    63
    64      /** The date the album was released. */
    65      public static final String MUSIC__RELEASE_DATE = "music:release_date";
    66
    67      /* END: http://ogp.me/#type_music.album */
    68
    69      /* BEGIN: http://ogp.me/#type_music.playlist */
    70
    71      /**
    72       * The creator of this playlist if 'music.playlist' or the creator of this station if 'music.radio_station'
    73       */
    74      public static final String MUSIC__CREATOR = "music:creator";
    75
    76      /* END: http://ogp.me/#type_music.playlist */
    77
    78      private static OGPMusic instance;
    79
    80      public static OGPMusic getInstance() {
    81          if (instance == null) {
    82              instance = new OGPMusic();
    83          }
    84          return instance;
    85      }
    86
    87      public final IRI NAMESPACE = createIRI(NS);
    88
    89      public final IRI musicDuration = createProperty(MUSIC__DURATION);
    90      public final IRI musicAlbum = createProperty(MUSIC__ALBUM);
    91      public final IRI musicAlbumDisc = createProperty(MUSIC__ALBUM_DISC);
    92      public final IRI musicAlbumTrack = createProperty(MUSIC__ALBUM_TRACK);
    93      public final IRI musicMusician = createProperty(MUSIC__MUSICIAN);
    94
    95      public final IRI musicSong = createProperty(MUSIC__SONG);
    96      public final IRI musicSongDisc = createProperty(MUSIC__SONG_DISC);
    97      public final IRI musicSongTrack = createProperty(MUSIC__SONG_TRACK);
    98      public final IRI musicReleaseDate = createProperty(MUSIC__RELEASE_DATE);
    99
    100     public final IRI musicCreator = createProperty(MUSIC__CREATOR);
    101
    102     @SuppressWarnings("unused")
    103     private IRI createClass(String localName) {
    104         return createClass(NS, localName);
    105     }
    106
    107     private IRI createProperty(String localName) {
    108         return createProperty(NS, localName);
    109     }
    110 }