Package thewebsemantic

Examples of thewebsemantic.Bean2RDF


  public static void main(String[] args) throws FileNotFoundException {
    try {
      Model m = ModelFactory.createDefaultModel();
      m.setNsPrefix("lt", "http://diplomski.nelakolundzija.org/LTontology.rdf#");
      Bean2RDF writer = new Bean2RDF(m);

      LearningToolCls lt = new LearningToolCls();
      lt.setTitle("WordPress");

      GeneralInformation gi = new GeneralInformationCls();
      gi.setDescription("WordPress is ...");
      gi.setToolURL("http://www.wordpress.com");

      TechnicalInformation ti = new TechnicalInformationCls();
      ti.setLaunchedTime("12-01-2001");
      ti.setVersion("2.9");
      ti.registration(true);
      ti.isOpenSource(false);

      Collection<Feature> features = new LinkedList<Feature>();
      Blog blog = new BlogCls();
      ContactList folowers = new ContactListCls();
      features.add(blog);
      features.add(folowers);

      lt.setFeatures(features);
      lt.setGeneralInfo(gi);
      lt.setTechnicalInfo(ti);

      writer.save(lt);

      m.write(new FileOutputStream("LearningTools.rdf"), "RDF/XML");
      m.write(System.out, "RDF/XML");

    } catch (Exception e) {
View Full Code Here


      m.setNsPrefix("jenabean", "http://thewebsemantic.com/");
      m.setNsPrefix("dc", "http://purl.org/dc/elements/1.1/");
      m.setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#");
      m.setNsPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
     
      Bean2RDF writer = new Bean2RDF(m);
     
      writer.saveDeep(lt);
      m.write(new FileOutputStream(fileName), syntax);
      m.write(System.out, "RDF/XML");
    } catch (Exception e) {
      System.err.println("Error!");
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of thewebsemantic.Bean2RDF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.