Package org.openrdf.model

Examples of org.openrdf.model.ValueFactory


   
    if(serviceUri == null)
      serviceUri = ConfigKeeper.getServiceUrl()+"/mbb/service/"+serviceId;

    Graph g = lr.getGraph();
    ValueFactory vf = g.getValueFactory();

    URI xsdString = XSD_STRING.getURI(g);
    URI xsdDateTime = XSD_DATETIME.getURI(g);
    URI xsdInt = XSD_INT.getURI(g);
    URI rdfType = vf.createURI(RDF.TYPE);
    URI context = vf.createURI(url);
    URI call = vf.createURI(serviceUri);
   
   
    String actionUri = url+"/action/";
    Resource lastAction = null;
   
   
    // --------------- BEGIN : to be removed -------------------------
//    if(axisPath.isInitial()) {
//      lastAction = AxisPath.getLastAction(globalLr, context, _usedPath);
//      if(lastAction != null)
//        _usedPath.add(0);
//    } else {
//      ///--- follows along axis
//      LocalRepository lr2 = Repository.TEMP_REPOSITORY.getLocalRepository();
//      lastAction =  axisPath.getLastOnList(globalLr, context, lr2.getGraph(), false, _usedPath);
//
//      //--inferr isFollowedBy properties
//      Graph ginf = SesameWrapper.performGraphQuery(lr2, QueryLanguage.SERQL, RDFQuery.RDFQ_INFER_ISFOLLOWEDBY.toString());
//      lr2.getGraph().add(ginf);
//    }
//   
//   
//    URI action = vf.createURI(actionUri+AxisPath.pathToString(_usedPath));
//   
//    if(globalg.contains(action,
//                globalg.getValueFactory().createURI(RDF.TYPE),
//                MBB_BROWSEACTION.getURI(globalg))) {
//      lastAction = AxisPath.getLastAction(globalLr, context, _usedPath);
//      if(lastAction != null)
//        _usedPath.add(0);
//      action = vf.createURI(actionUri+AxisPath.pathToString(_usedPath));
//    }
    // --------------- END : to be removed -------------------------
   
    Graph globalg = globalLr.getGraph();
    boolean isGetLastAction = false;
   
    //--A
    if(axisPath.isInitial()) //--A.1
      isGetLastAction = true;
    else {//--A.2
      LocalRepository lr2 = RepositoryFactory.createTempRepository();
      lastAction =  axisPath.getLastOnList(globalLr, context, lr2.getGraph(), false, _usedPath);

      //--inferr isFollowedBy properties
      Graph ginf = SesameWrapper.performGraphQuery(lr2, QueryLanguage.SERQL, RDFQuery.RDFQ_INFER_ISFOLLOWEDBY.toString());
      lr2.getGraph().add(ginf);

      //--B
      if((axisPath.getPath().size() - 1) == _usedPath.size())//--B.1
        _usedPath.add(axisPath.getPath().get(axisPath.getPath().size()-1));
      else if(lastAction != null){//--B.2
        StatementIterator stit = lr2.getGraph().getStatements(lastAction, MultiBeeBrowseRDF.MBB_ISFOLLOWEDSALONGAXIS.getURI(lr2.getGraph()), null);
        Set<Integer> saxis = new HashSet<Integer>();
       
        while(stit.hasNext()) {
          saxis.add(Integer.parseInt(((Literal)stit.next().getObject()).getLabel()));
        }
       
        //--C
        if(saxis.size() >= 6)//--C.1
          _usedPath.add(0);
        else {//--C.2
          int i = 0;
         
          while(saxis.contains(i) && i < 6) {
            i++;
          }
         
          if(i < 6) //--C.2.1
            _usedPath.add(i);
          else //--C.2.2
            isGetLastAction = true;
        }
      }else
        _usedPath.clear();//XXX just to make sure
    }

    URI action = (!isGetLastAction)?vf.createURI(actionUri+AxisPath.pathToString(_usedPath)):null;
   
    if(isGetLastAction ||
       globalg.contains(action, globalg.getValueFactory().createURI(RDF.TYPE), MBB_BROWSEACTION.getURI(globalg))) {
        _usedPath.clear();
       
        lastAction = AxisPath.getLastAction(globalLr, context, _usedPath);
        if(lastAction != null)
          _usedPath.add(0);
        action = vf.createURI(actionUri+AxisPath.pathToString(_usedPath));
    }
   
    g.add(action,
        rdfType,
        MBB_BROWSEACTION.getURI(g));
   
    g.add(action,
        DC_CREATOR.getURI(g),
        (_user.indexOf("mailto:")==0 ||
             _user.indexOf("user:")==0 ||
             _user.indexOf("ip:")==0)?vf.createURI(_user):vf.createLiteral(_user, xsdString));
    g.add(action,
        MBB_CREATEDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));
    g.add(action,
        MBB_ACCESSDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));
    g.add(action,
        MBB_UPDATEDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));

    ///--- is in context
    g.add(action,
        MBB_ISINCONTEXT.getURI(g),
        context);

    ///--- execute
    g.add(action,
        MBB_EXECUTE.getURI(g),
        call);
   
    ///--- type=mbb:Call
    if(!globalLr.getGraph().contains(call, rdfType, MBB_CALL.getURI(g)))
      g.add(call, rdfType, MBB_CALL.getURI(g));

//    if(axisPath.isInitial()) {
    if(_usedPath.size() == 0) {
      if(lastAction != null) {
        Repository.logger.severe("ActionAccessContextService:newAction - this should not happen!");
        g.add(action,
            MBB_FOLLOWSALONGAXIS.getURI(g),
            vf.createLiteral("0", xsdInt));
   
        g.add(action,
            MBB_FOLLOWS.getURI(g),
            lastAction);
      }else
        g.add(context, MBB_HASFIRSTACTION.getURI(g), action);
     
    } else {
      ///--- follows along axis
      int axis = _usedPath.get(_usedPath.size()-1);
     
      if(lastAction != null) {
        //TODO ******** check if the axis is allowed (reimplement with cartesian space support) *****************
        URI pfollows = MBB_FOLLOWS.getURI(g);
//       
//        if(!g.contains(lastAction, pfollows, vf.createLiteral(String.valueOf((axis+3)%6), xsdInt))) { XXX
          g.add(action,
              MBB_FOLLOWSALONGAXIS.getURI(g),
              vf.createLiteral(String.valueOf(axis), xsdInt));
   
          g.add(action,
              pfollows,
              lastAction);
         
View Full Code Here


    }
   
    this.getRequestParams().put("contextURI", new FieldValueWrapper(_uri));
   
    Graph g = lr.getGraph();
    ValueFactory vf = g.getValueFactory();
    URI contextUri = vf.createURI(_uri);
    URI xsdString = XSD_STRING.getURI(g);
    URI xsdDateTime = XSD_DATETIME.getURI(g);
   
    g.add(contextUri,
        vf.createURI(RDF.TYPE),
        MBB_BROWSECONTEXT.getURI(g));
   
    g.add(contextUri,
          DC_CREATOR.getURI(g),
          (_user.indexOf("mailto:")==0 ||
           _user.indexOf("user:")==0 ||
           _user.indexOf("ip:")==0)?vf.createURI(_user):vf.createLiteral(_user, xsdString));

    g.add(contextUri,
        MBB_CREATEDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));
    g.add(contextUri,
        MBB_ACCESSDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));
    g.add(contextUri,
        MBB_UPDATEDATE.getURI(g),
        vf.createLiteral(date, xsdDateTime));
     
    Repository.MAIN_REPOSITORY.getLocalRepository().addGraph(g);
  }
View Full Code Here

        return object;
    }
   
  
    public static void serializeRDFJSON(Map<String,Metadata> data, OutputStream out) throws IOException {
        ValueFactory vf = ValueFactoryImpl.getInstance();
        Model results = new LinkedHashModel();
       
        for(Map.Entry<String,Metadata> subject : data.entrySet()) {
            Resource subjectResource = stringToResource(subject.getKey(), vf);
            for(Map.Entry<String,Set<RDFNode>> predicate : subject.getValue().entrySet()) {
                org.openrdf.model.URI predicateURI = vf.createURI(predicate.getKey());
                for(RDFNode objectNode : predicate.getValue()) {
                    org.openrdf.model.Value objectValue;
                    if( objectNode instanceof Literal) {
                        if(((Literal) objectNode).getLanguage() != null )
                            objectValue = vf.createLiteral(((Literal)objectNode).getContent(),
                                                ((Literal)objectNode).getLanguage());
                        else if(((Literal) objectNode).getType() != null)
                            objectValue = vf.createLiteral(((Literal)objectNode).getContent(),
                                                vf.createURI(((Literal)objectNode).getType().getUri()));
                        else
                            objectValue = vf.createLiteral(((Literal)objectNode).getContent());
                    } else {
                        if( objectNode instanceof URI ) {
                            objectValue = vf.createURI(((URI)objectNode).getUri());
                        } else {
                            objectValue = vf.createBNode(((BNode)objectNode).getAnonId());
                        }
                    }
                    results.add(subjectResource, predicateURI, objectValue);
                }
            }
View Full Code Here

        ObjectMapper mapper = new ObjectMapper();

        try {
            Map<String,Object> data = mapper.readValue(in, new TypeReference<Map<String,Object>>() { });

            ValueFactory vf = ValueFactoryImpl.getInstance();

            URI subject = vf.createURI(resourceUri);

            // add the type based on the facebook category
            if(data.get("category") != null) {
                model.add(subject, RDF.TYPE, getType(data.get("category").toString()));
            }

            model.add(subject,DCTERMS.identifier,vf.createLiteral(data.get("id").toString()));

            // schema:name is the facebook name (can have multiple languages)
            model.add(subject, SCHEMA.name, vf.createLiteral(data.get("name").toString(), language));
            model.add(subject, DCTERMS.title, vf.createLiteral(data.get("name").toString(), language));

            // dct:description in case a description or about is present (all content in English)
            if(data.get("description") != null) {
                model.add(subject,SCHEMA.description, vf.createLiteral(data.get("description").toString(), "en"));
                model.add(subject,DCTERMS.description, vf.createLiteral(data.get("description").toString(), "en"));
            }
            if(data.get("about") != null) {
                model.add(subject,SCHEMA.description, vf.createLiteral(data.get("about").toString(), "en"));
                model.add(subject,DCTERMS.description, vf.createLiteral(data.get("about").toString(), "en"));
            }

            // if there is genre information, add it using schema:genre and dct:subject
            if(data.get("genre") != null) {
                model.add(subject,SCHEMA.genre, vf.createLiteral(data.get("genre").toString()));
                model.add(subject,DCTERMS.subject, vf.createLiteral(data.get("genre").toString()));
            }
            if(data.get("directed_by") != null) {
                model.add(subject,SCHEMA.director, vf.createLiteral(data.get("directed_by").toString()));
                model.add(subject,DCTERMS.creator, vf.createLiteral(data.get("directed_by").toString()));
            }
            if(data.get("studio") != null) {
                model.add(subject,SCHEMA.publisher, vf.createLiteral(data.get("studio").toString()));
                model.add(subject,DCTERMS.publisher, vf.createLiteral(data.get("studio").toString()));
            }
            if(data.get("plot_outline") != null) {
                model.add(subject,SCHEMA.description, vf.createLiteral(data.get("plot_outline").toString()));
                model.add(subject,DCTERMS.description, vf.createLiteral(data.get("plot_outline").toString()));
            }
            if(data.get("phone") != null) {
                model.add(subject,SCHEMA.telephone, vf.createLiteral(data.get("phone").toString()));
                model.add(subject,FOAF.phone, vf.createLiteral(data.get("phone").toString()));
            }
            if(data.get("username") != null) {
                model.add(subject,FOAF.nick, vf.createLiteral(data.get("username").toString()));
            }

            if(data.get("cover") != null && data.get("cover") instanceof Map && ((Map<?,?>)data.get("cover")).get("source") != null) {
                model.add(subject,FOAF.thumbnail, vf.createURI(((Map<?,?>) data.get("cover")).get("source").toString()));
            }



            // website
            if(data.get("website") != null && UriUtil.validate(data.get("website").toString())) {
                model.add(subject, FOAF.homepage, vf.createURI(data.get("website").toString()));
            }
            if(data.get("link") != null) {
                model.add(subject, FOAF.homepage, vf.createURI(data.get("link").toString()));
            }

        } catch (JsonMappingException e) {
            throw new DataRetrievalException("error while mapping JSON response",e);
        } catch (JsonParseException e) {
View Full Code Here

        Assert.assertNotEquals(LiteralCommons.createCacheKey("abc",null,(URI)null), LiteralCommons.createCacheKey("ABC",null,(URI)null));

        Repository repository = new SailRepository(new MemoryStore());
        repository.initialize();

        ValueFactory vf = repository.getValueFactory();

        // create a string literal without language and datatype and test if the hash key is correct between
        // the different methods
        String value1 = RandomStringUtils.random(128);
        Literal literal1 = vf.createLiteral(value1);

        Assert.assertEquals(LiteralCommons.createCacheKey(value1,null,(String)null),LiteralCommons.createCacheKey(literal1));
        Assert.assertEquals(LiteralCommons.createCacheKey(value1,null,(URI)null),LiteralCommons.createCacheKey(literal1));

        // create a string literal with language and without datatype and test if the hash key is correct between
        // the different methods
        String value2 = RandomStringUtils.random(128);
        Locale locale2 = Locale.getDefault();
        Literal literal2 = vf.createLiteral(value2,locale2.getLanguage().toLowerCase());

        Assert.assertEquals(LiteralCommons.createCacheKey(value2,locale2,(String)null),LiteralCommons.createCacheKey(literal2));
        Assert.assertEquals(LiteralCommons.createCacheKey(value2,locale2,(URI)null),LiteralCommons.createCacheKey(literal2));

        // create a string literal with datatype and without language and test if the hash key is correct between
        // the different methods
        String value3 = RandomStringUtils.randomNumeric(3);
        String datatype3 = Namespaces.NS_XSD + "integer";
        Literal literal3 = vf.createLiteral(value3, vf.createURI(datatype3));

        Assert.assertEquals(LiteralCommons.createCacheKey(value3,null,datatype3),LiteralCommons.createCacheKey(literal3));


        // create a Date literal and test whether the hash key is correct between the different methods
        Date value4 = new Date();
        String datatype4 = LiteralCommons.getXSDType(value4.getClass());
        Literal literal4 = vf.createLiteral(DateUtils.getXMLCalendar(value4));

        Assert.assertEquals(datatype4,literal4.getDatatype().stringValue());
        Assert.assertEquals(LiteralCommons.createCacheKey(value4,datatype4), LiteralCommons.createCacheKey(literal4));

        repository.shutDown();
View Full Code Here

            ExtractionContext extractionContext,
            Document in,
            ExtractionResult out
    ) throws IOException, ExtractionException {
        HTMLDocument html = new HTMLDocument(in);
        ValueFactory vf = ValueFactoryImpl.getInstance();

        final List<Node> headLinkNodes = DomUtils.findAll(
                in,
                "/HTML/HEAD/LINK[(" +
                        "@type='application/rdf+xml' or " +
                        "@type='text/rdf' or " +
                        "@type='application/x-turtle' or " +
                        "@type='application/turtle' or " +
                        "@type='text/turtle' or " +
                        "@type='text/rdf+n3'" +
                        ") and @href and @rel]"
        );
        for (Node node : headLinkNodes) {
            final URI href = html.resolveURI(DomUtils.find(node, "@href"));
            final String rel = DomUtils.find(node, "@rel");
            out.writeTriple(
                    extractionContext.getDocumentURI(),
                    vf.createURI(XHTML.NS + rel),
                    href
            );
            final String title = DomUtils.find(node, "@title");
            if (title != null && !"".equals(title)) {
                out.writeTriple(
                        href,
                        getDescription().getPrefixes().expand("dcterms:title"),
                        vf.createLiteral(title)
                );
            }
            final String type = DomUtils.find(node, "@type");
            if (type != null && !"".equals(type)) {
                out.writeTriple(
                        href,
                        getDescription().getPrefixes().expand("dcterms:format"),
                        vf.createLiteral(type)
                );
            }
        }
    }
View Full Code Here

            lon = Float.parseFloat(coords[1]);
        } catch (NumberFormatException nfe) {
            return;
        }

        final ValueFactory factory = new Any23ValueFactoryWrapper(ValueFactoryImpl.getInstance(), out);
        BNode point = factory.createBNode();
        out.writeTriple(extractionContext.getDocumentURI(), expand("dcterms:related"), point);
        out.writeTriple(point, expand("rdf:type"), expand("geo:Point"));
        out.writeTriple(point, expand("geo:lat"), factory.createLiteral(Float.toString(lat)));
        out.writeTriple(point, expand("geo:long"), factory.createLiteral(Float.toString(lon)));
    }
View Full Code Here

    model.initialize();
   
    RepositoryConnection con = null;
    try{
      con = model.getConnection();
      ValueFactory vf = con.getValueFactory();
     
      //create persons
      URI person1 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#tim-finin", "Tim Finin", "finin@umbc.edu");
      URI person2 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#lushan-han", "Lushan Han", "lushan@umbc.edu");
      URI person3 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#wenjia-li", "Wenjia Li", "wenjia@umbc.edu");
   
      //office numbers
      URI officeNumberProp = vf.createURI("http://lab.linkeddata.deri.ie/test#officeNumber");
      con.add(vf.createStatement(person1, officeNumberProp, vf.createLiteral(329)));
      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
      con.add(vf.createStatement(advisor, vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral("Anupam Joshi")));
      URI advisorType = vf.createURI("http://lab.linkeddata.deri.ie/test#Advisor");
      con.add(vf.createStatement(advisor, RDF.TYPE, advisorType));
      con.add(vf.createStatement(person1, RDF.TYPE, advisorType));
   
      //university
      URI university = vf.createURI("http://example.org/UMBC");
      con.add(vf.createStatement(university,RDF.TYPE, vf.createURI("http://xmlns.com/foaf/0.1/Organization")));
      con.add(vf.createStatement(university,RDFS.LABEL,vf.createLiteral("University of Maryland Baltimore County","en")));
   
      URI memberProp = vf.createURI("http://xmlns.com/foaf/0.1/member");
      con.add(vf.createStatement(person1,memberProp,university));
      con.add(vf.createStatement(person2,memberProp,university));
      con.add(vf.createStatement(person3,memberProp,university));
   
      //add advisor
      URI advisorProp = vf.createURI("http://lab.linkeddata.deri.ie/test#advisor");
      con.add(vf.createStatement(person2,advisorProp,person1));
      con.add(vf.createStatement(person3,advisorProp,advisor));
   
      return model;
    }finally{
      con.close();
    }
View Full Code Here

    model.initialize();
   
    RepositoryConnection con = null;
    try{
      con = model.getConnection();
      ValueFactory vf = con.getValueFactory();
     
      //create persons
      URI person1 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#tim-finin", "Tim Finin", "finin@umbc.edu");
      URI person2 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#lushan-han", "Lushan Han", "lushan@umbc.edu");
      URI person3 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#wenjia-li", "Wenjia Li", "wenjia@umbc.edu");
   
      //office numbers
      URI officeNumberProp = vf.createURI("http://lab.linkeddata.deri.ie/test#officeNumber");
      con.add(vf.createStatement(person1, officeNumberProp, vf.createLiteral(329)));
      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
      con.add(vf.createStatement(advisor, vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral("Anupam Joshi")));
      URI advisorType = vf.createURI("http://lab.linkeddata.deri.ie/test#Advisor");
      con.add(vf.createStatement(advisor, RDF.TYPE, advisorType));
      con.add(vf.createStatement(person1, RDF.TYPE, advisorType));
   
      //university
      URI university = vf.createURI("http://example.org/UMBC");
      con.add(vf.createStatement(university,RDF.TYPE, vf.createURI("http://xmlns.com/foaf/0.1/Organization")));
      con.add(vf.createStatement(university,RDFS.LABEL,vf.createLiteral("University of Maryland Baltimore County","en")));
   
      URI memberProp = vf.createURI("http://xmlns.com/foaf/0.1/member");
      con.add(vf.createStatement(person1,memberProp,university));
      con.add(vf.createStatement(person2,memberProp,university));
      con.add(vf.createStatement(person3,memberProp,university));
   
      //add advisor
      URI advisorProp = vf.createURI("http://lab.linkeddata.deri.ie/test#advisor");
      con.add(vf.createStatement(person2,advisorProp,person1));
      con.add(vf.createStatement(person3,advisorProp,advisor));
     
      //second root node data
      URI adviseProp = vf.createURI("http://lab.linkeddata.deri.ie/test#advise");
      con.add(vf.createStatement(person1, adviseProp, person2));
      con.add(vf.createStatement(advisor, adviseProp, person3));
   
      //
      URI scienceCollege = vf.createURI("http://example.org/ScienceCollege");
      URI collegeProp = vf.createURI("http://lab.linkeddata.deri.ie/test#college");
      con.add(vf.createStatement(person2, collegeProp, scienceCollege));
      con.add(vf.createStatement(person3, collegeProp, scienceCollege));
     
      return model;
    }finally{
      con.close();
    }
View Full Code Here

    RepositoryConnection con = null;
    try{
      Repository repo = new SailRepository(new MemoryStore());
      repo.initialize();
      con = repo.getConnection();
      ValueFactory vf = con.getValueFactory();
   
      URI post = vf.createURI("http://reference.data.gov.uk/id/department/bis/post/101198");
      con.add(vf.createStatement(post, RDF.TYPE, vf.createURI("http://reference.data.gov.uk/def/central-government/CivilServicePost")));
   
      con.add(vf.createStatement(post, RDFS.LABEL, (Value)vf.createLiteral("Deputy Director - International Group","en")));
   
      URI person = vf.createURI("http://data.bis.gov.uk/data/organogram/2010-08-26/person0");
      con.add(vf.createStatement(person, RDF.TYPE, vf.createURI("http://xmlns.com/foaf/0.1/Person")));
      con.add(vf.createStatement(person,
                vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral( "Paula Freedman")));
      con.add(vf.createStatement(person,
          vf.createURI("http://xmlns.com/foaf/0.1/mbox"), vf.createURI("mailto:paula.freedman@ukti.gsi.gov.uk")));
     
      Resource unit = vf.createURI("http://data.bis.gov.uk/data/organogram/2010-08-26/uk-trade-and-investment");
      con.add(vf.createStatement(unit, vf.createURI("http://reference.data.gov.uk/def/central-government/hasPost"), post));
      con.add(vf.createStatement(post, vf.createURI("http://reference.data.gov.uk/def/central-government/postIn"), unit));
      con.add(vf.createStatement(post, vf.createURI("http://reference.data.gov.uk/def/central-government/heldBy"), person));
     
      /*
       * 111912|  Bryan Welch|  G5|  Deputy Director - Legal Services Directorate B|  tbc|  BIS|  BIS|  Legal Services Group|  020 7215 3181|  bryan.welch@bis.gsi.gov.uk|  901575|  Stephen Braviner-Roman|  Senior Civil Service.Pay Band 1|  Active Assignment    TRUE  TRUE  FALSE
       */
      URI post2 = vf.createURI("http://reference.data.gov.uk/id/department/bis/post/111912");
      con.add(vf.createStatement(post2,RDF.TYPE,vf.createURI("http://reference.data.gov.uk/def/central-government/CivilServicePost")));
      con.add(vf.createStatement(post2,RDFS.LABEL,vf.createLiteral("Deputy Director - Legal Services Directorate B","en")));
     
      URI person2 = vf.createURI("http://data.bis.gov.uk/data/organogram/2010-08-26/person1");
      con.add(vf.createStatement(person2,RDF.TYPE,vf.createURI("http://xmlns.com/foaf/0.1/Person")));
      con.add(vf.createStatement(person2,vf.createURI("http://xmlns.com/foaf/0.1/name"),vf.createLiteral("Bryan Welch")));
      con.add(vf.createStatement(person2,vf.createURI("http://xmlns.com/foaf/0.1/mbox"),vf.createURI("mailto:bryan.welch@bis.gsi.gov.uk")));
     
      URI unit2 = vf.createURI("http://data.bis.gov.uk/data/organogram/2010-08-26/legal-services-group");
     
      con.add(vf.createStatement(unit2, vf.createURI("http://reference.data.gov.uk/def/central-government/hasPost"), post2));
      con.add(vf.createStatement(post2, vf.createURI("http://reference.data.gov.uk/def/central-government/postIn"), unit2));
      con.add(vf.createStatement(post2, vf.createURI("http://reference.data.gov.uk/def/central-government/heldBy"), person2));
     
      return repo;
    }finally{
      con.close();
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.ValueFactory

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.