Skip to content

Instantly share code, notes, and snippets.

@turumbay
Created March 11, 2011 21:43
Show Gist options
  • Save turumbay/866632 to your computer and use it in GitHub Desktop.
Save turumbay/866632 to your computer and use it in GitHub Desktop.
package ru.turumbay.jena;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
public class VCardExample {
public static void main(String... args) {
Model model = ModelFactory.createDefaultModel();
model.setNsPrefix("vcard", VCard.NS);
model.createResource("http://turumbay.ru/me")
.addProperty(VCard.fn, "Golberg Ilya")
.addProperty(VCard.email, "turumbay@gmail.com")
.addProperty(
VCard.n,
model.createResource()
.addProperty(VCard.given_name, "Ilya")
.addProperty(VCard.additional_name, "Y")
.addProperty(VCard.family_name, "Golberg"));
model.write(System.out, "TURTLE");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment