Package org.deri.grefine.rdf.vocab

Examples of org.deri.grefine.rdf.vocab.Vocabulary


      Map<String, Vocabulary> prefixesMap = new HashMap<String, Vocabulary>();
      JSONArray prefixesArr = ParsingUtilities.evaluateJsonStringToArray(request.getParameter("prefixes"));
      for(int i =0;i<prefixesArr.length();i++){
        JSONObject prefixObj = prefixesArr.getJSONObject(i);
        String name = prefixObj.getString("name");
        prefixesMap.put(name,new Vocabulary(name, prefixObj.getString("uri")));
      }
      getRdfSchema(request).setPrefixesMap(prefixesMap);
     
      String projectId = request.getParameter("project");
      getRdfContext().getVocabularySearcher().synchronize(projectId, prefixesMap.keySet());
View Full Code Here


        String name = tokenizer.nextToken();
        String uri = tokenizer.nextToken();
        String url = tokenizer.nextToken();
        //import and index
        this.applicationContext.getVocabularySearcher().importAndIndexVocabulary(name, uri,url, new VocabularyImporter());
        this.predefinedVocabulariesMap.put(name,new Vocabulary(name, uri));
      } catch (Exception e) {
        // predefined vocabularies are not defined properly
        // ignore the exception, just log it
        logger.warn("unable to add predefined vocabularies", e);
      }
View Full Code Here

            JSONArray prefixes = obj.getJSONArray("prefixes");
            for(int i=0;i<prefixes.length();i++){
              JSONObject p = prefixes.getJSONObject(i);
              String name = p.getString("name");
              String uri = p.getString("uri");
              this.predefinedVocabulariesMap.put(name,new Vocabulary(name,uri));
            }
        } finally {
            reader.close();
        }
View Full Code Here

    public void addPrefix(String name, String uri) throws PrefixExistException{
      synchronized(prefixesMap){
        if(this.prefixesMap.containsKey(name)){
          throw new PrefixExistException(name + " already defined");
        }
        this.prefixesMap.put(name, new Vocabulary(name, uri));
      }
    }
View Full Code Here

          prefixesArr = new JSONArray();
        }
        for (int i = 0; i < prefixesArr.length(); i++) {
          JSONObject prefixObj = prefixesArr.getJSONObject(i);
          String name = prefixObj.getString("name");
          s.prefixesMap.put(name,new Vocabulary(name, prefixObj.getString("uri")));
        }
       
        JSONArray rootNodes = o.getJSONArray("rootNodes");
        int count = rootNodes.length();
View Full Code Here

    }
   
    private Map<String,Vocabulary> clone(Map<String,Vocabulary> original){
      Map<String,Vocabulary> copy = new HashMap<String, Vocabulary>();
      for(Entry<String, Vocabulary> entry : original.entrySet()){
        copy.put(entry.getKey(), new Vocabulary(entry.getValue().getName(),entry.getValue().getUri()));
      }
     
      return copy;
    }
View Full Code Here

TOP

Related Classes of org.deri.grefine.rdf.vocab.Vocabulary

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.