Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //od 15 do 17
- static final String inputFileName = "C:\\Users\\Mitko\\Documents\\lab1_vbs\\mitko2.xml";
- static String MitkoJosifoskiUri="http://somewhere/MitkoJosifoski";
- public static void main(String[] args) {
- Model model = ModelFactory.createDefaultModel();
- InputStream in = FileManager.get().open( inputFileName );
- if (in == null) {
- throw new IllegalArgumentException( "File: " + inputFileName + " not found");
- }
- model.read(in, "", "RDF/XML");
- Resource vcard = model.getResource(MitkoJosifoskiUri);
- Resource name = (Resource) vcard.getRequiredProperty(VCARD.N)
- .getObject();
- String fullName = vcard.getRequiredProperty(VCARD.FN)
- .getString();
- vcard.addProperty(VCARD.NICKNAME, "Mitce")
- .addProperty(VCARD.NICKNAME, "Mite");
- System.out.println("The nicknames of \"" + fullName + "\" are:");
- StmtIterator iter = vcard.listProperties(VCARD.NICKNAME);
- while (iter.hasNext()) {
- System.out.println(" " + iter.nextStatement().getObject()
- .toString());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement