##### Coverage Report - org.apache.any23.vocab.XFN

Classes in this File | Line Coverage | Branch Coverage | Complexity
XFN |
0% | 0/36
0% | 0/6
| 1.4285714285714286;1.429

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 |  |
     import java.util.HashMap;
23 |  |
     import java.util.Map;
24 |  |
25 |  |
     /**
26 |  |
      * Vocabulary class for <a href="http://gmpg.org/xfn/11">XFN</a>, as per
27 |  |
      * <a href="http://vocab.sindice.com/xfn/guide.html">Expressing XFN in RDF</a>.
28 |  |
      *
29 |  |
      * @author Richard Cyganiak (richard@cyganiak.de)
30 |  |
      */
31 |  |
     public class XFN extends Vocabulary {
32 |  |
33 |  |
         public static final String NS = "http://vocab.sindice.com/xfn#";
34 |  |
35 |  |
         private static XFN instance;
36 |  |
37 |  |
         public static XFN getInstance() {
38 | 0 |
             if(instance == null) {
39 | 0 |
                 instance = new XFN();
40 |  |
             }
41 | 0 |
             return instance;
42 |  |
         }
43 |  |
44 | 0 |
         public final URI contact      = createProperty("contact");
45 | 0 |
         public final URI acquaintance = createProperty("acquaintance");
46 | 0 |
         public final URI friend       = createProperty("friend");
47 | 0 |
         public final URI met          = createProperty("met");
48 | 0 |
         public final URI coWorker     = createProperty("co-worker");
49 | 0 |
         public final URI colleague    = createProperty("colleague");
50 | 0 |
         public final URI coResident   = createProperty("co-resident");
51 | 0 |
         public final URI neighbor     = createProperty("neighbor");
52 | 0 |
         public final URI child        = createProperty("child");
53 | 0 |
         public final URI parent       = createProperty("parent");
54 | 0 |
         public final URI spouse       = createProperty("spouse");
55 | 0 |
         public final URI kin          = createProperty("kin");
56 | 0 |
         public final URI muse         = createProperty("muse");
57 | 0 |
         public final URI crush        = createProperty("crush");
58 | 0 |
         public final URI date         = createProperty("date");
59 | 0 |
         public final URI sweetheart   = createProperty("sweetheart");
60 | 0 |
         public final URI me           = createProperty("me");
61 |  |
62 | 0 |
         public final URI mePage = createProperty(NS, "mePage");
63 |  |
64 |  |
         private  Map<String, URI> PeopleXFNProperties;
65 |  |
66 |  |
         private Map<String, URI> HyperlinkXFNProperties;
67 |  |
68 |  |
         public URI getPropertyByLocalName(String localName) {
69 | 0 |
             return PeopleXFNProperties.get(localName);
70 |  |
         }
71 |  |
72 |  |
         public URI getExtendedProperty(String localName) {
73 | 0 |
             return HyperlinkXFNProperties.get(localName);
74 |  |
         }
75 |  |
76 |  |
         public boolean isXFNLocalName(String localName) {
77 | 0 |
             return PeopleXFNProperties.containsKey(localName);
78 |  |
         }
79 |  |
80 |  |
         public boolean isExtendedXFNLocalName(String localName) {
81 | 0 |
             return PeopleXFNProperties.containsKey(localName);
82 |  |
         }
83 |  |
84 |  |
         private URI createProperty(String localName) {
85 | 0 |
             if(HyperlinkXFNProperties == null) {
86 | 0 |
                 HyperlinkXFNProperties = new HashMap<String, URI>();
87 |  |
             }
88 | 0 |
             if(PeopleXFNProperties == null) {
89 | 0 |
                 PeopleXFNProperties =  new HashMap<String, URI>();
90 |  |
             }
91 |  |
92 | 0 |
             URI result = createProperty(NS, localName + "-hyperlink");
93 | 0 |
             HyperlinkXFNProperties.put(localName, result);
94 |  |
95 | 0 |
             result = createProperty(NS, localName);
96 | 0 |
             PeopleXFNProperties.put(localName, result);
97 | 0 |
             return result;
98 |  |
         }
99 |  |
100 |  |
         private XFN(){
101 | 0 |
             super(NS);
102 | 0 |
         }
103 |  |
104 |  |
     }