| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 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 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 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 | |
} |