Search in sources :

Example 1 with VCardBuilder

use of net.fortuna.ical4j.vcard.VCardBuilder in project stanbol by apache.

the class VcardIndexingSource method main.

public static void main(String[] args) throws Exception {
    VcardIndexingSource instance = new VcardIndexingSource();
    instance.prefix = "http://test.org/";
    VCardBuilder parser = new VCardBuilder(new InputStreamReader(new FileInputStream(new File(args[0])), "utf8"));
    Map<EntityType, Map<String, Set<String>>> entityMap = new EnumMap<EntityType, Map<String, Set<String>>>(EntityType.class);
    entityMap.put(EntityType.organization, new HashMap<String, Set<String>>());
    entityMap.put(EntityType.person, new HashMap<String, Set<String>>());
    for (VCard vcard : parser.buildAll()) {
        instance.processVcard(vcard, OntologyMappings.schemaOrgMappings, entityMap);
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) InputStreamReader(java.io.InputStreamReader) FileInputStream(java.io.FileInputStream) VCardBuilder(net.fortuna.ical4j.vcard.VCardBuilder) File(java.io.File) EnumMap(java.util.EnumMap) Map(java.util.Map) EnumMap(java.util.EnumMap) HashMap(java.util.HashMap) VCard(net.fortuna.ical4j.vcard.VCard)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStreamReader (java.io.InputStreamReader)1 EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 VCard (net.fortuna.ical4j.vcard.VCard)1 VCardBuilder (net.fortuna.ical4j.vcard.VCardBuilder)1