com.hp.hpl.jena.graph.Graph.getPrefixMapping()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中com.hp.hpl.jena.graph.Graph.getPrefixMapping()方法的一些代码示例,展示了Graph.getPrefixMapping()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getPrefixMapping()方法的具体详情如下:
包路径:com.hp.hpl.jena.graph.Graph
类名称:Graph
方法名:getPrefixMapping

Graph.getPrefixMapping介绍

[英]returns this Graph's prefix mapping. Each call on a given Graph gets the same PrefixMapping object, which is the one used by the Graph.
[中]返回此图的前缀映射。对给定图形的每次调用都会获得相同的PrefixMapping对象,即图形所使用的对象。

代码示例

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public PrefixMapping getPrefixMapping()
{
  return graph.getPrefixMapping() ;
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.remote

@Override public PrefixMapping getPrefixMapping() {
  return g.getPrefixMapping();
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override public void prefix(String prefix, String uri)
  {
    try { // Jena applies XML rules to prerfixes.
      graph.getPrefixMapping().setNsPrefix(prefix, uri) ;
    } catch (JenaException ex) {} 
  }
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
   Inference graphs share the prefix-mapping of their underlying raw graph.
   @see com.hp.hpl.jena.graph.Graph#getPrefixMapping()
*/
@Override
public PrefixMapping getPrefixMapping()
  { return getRawGraph().getPrefixMapping(); }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

private PrefixMapping getBaseMapping()
  { 
  Graph base = poly.getBaseGraph();
  return base == null ? pending : base.getPrefixMapping(); 
  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public ParserOutputDataset(DatasetGraph dsg)
{ 
  this.dsg = dsg ;
  this.prefixMapping = dsg.getDefaultGraph().getPrefixMapping() ;
  // = dsg.getPrefixMapping().setNsPrefix(prefix, uri) ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override
  public void prefix(int line, int col, String prefix, String iri)
  { graph.getPrefixMapping().setNsPrefix(prefix, iri) ; }
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

private PrefixMapping getPrefixMapping()
{ return getGraph().getPrefixMapping(); }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  When the graph is constructed, copy the prefix mappings of both components
  into this prefix mapping. The prefix mapping doesn't change afterwards with the
  components, which might be regarded as a bug.
*/
public Dyadic( Graph L, Graph R )
  {
  this.L = L;
  this.R = R;
  getPrefixMapping()
    .setNsPrefixes( L.getPrefixMapping() )
    .setNsPrefixes( R.getPrefixMapping() )
    ;
  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

private static PrefixMapping modelToPrefixMapping( Model model )
  {
  return model == null 
    ? PrefixMapping.Factory.create() 
    : model.getGraph().getPrefixMapping()
    ;
  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

/** Return a SerializationContext appropriate for the graph */
public static SerializationContext sCxt(Graph graph)
{
  if ( graph != null )
    return sCxt(graph.getPrefixMapping()) ;
  return new SerializationContext() ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

/** Return a SerializationContext appropriate for the graph */
public static SerializationContext sCxt(Graph graph)
{
  if ( graph != null )
    return sCxt(graph.getPrefixMapping()) ;
  return new SerializationContext() ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static PrefixMap prefixMap(DatasetGraph dsg)
{
  return PrefixMapFactory.create(dsg.getDefaultGraph().getPrefixMapping()) ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

private static PrefixMap prefixMap(DatasetGraph dataset)
{
  return PrefixMapFactory.create(dataset.getDefaultGraph().getPrefixMapping()) ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override public Map<String, String> getNsPrefixMap()
  { 
  Map<String, String> result = CollectionFactory.createHashedMap();
  List<Graph> graphs = poly.getSubGraphs();
  for (int i = graphs.size(); i > 0;)
    result.putAll( graphs.get( --i ).getPrefixMapping().getNsPrefixMap() );
  result.remove( "" );
  result.putAll( getBaseMapping().getNsPrefixMap() );
  return result; 
  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override public String getNsURIPrefix( String uri )
  {
  String s = getBaseMapping().getNsURIPrefix( uri );
  if (s == null)
    {
    List<Graph> graphs = poly.getSubGraphs();
    for (int i = 0; i < graphs.size(); i += 1)
      {
      String ss = graphs.get(i).getPrefixMapping().getNsURIPrefix( uri );
      if (ss != null && ss.length() > 0) return ss;
      }
    }
  return s;
  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override public String qnameFor( String uri )
  {
  String result = getBaseMapping().qnameFor( uri );
  if (result == null)
    {
    List<Graph> graphs = poly.getSubGraphs();
    for (int i = 0; i < graphs.size(); i += 1)
      {
      String ss = graphs.get(i).getPrefixMapping().qnameFor( uri );
      if (ss != null) return ss;
      }
    }
  return result;
  }
}

代码示例来源:origin: com.hp.hpl.jena/arq

public static void write(IndentedWriter out, Graph graph)
{ 
  WriterGraph.output(out, graph, 
            new SerializationContext(graph.getPrefixMapping())) ;
  out.ensureStartOfLine() ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static void write(IndentedWriter out, Graph graph)
{ 
  WriterGraph.output(out, graph, 
            new SerializationContext(graph.getPrefixMapping())) ;
  out.ensureStartOfLine() ;
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
protected PrefixMapping createPrefixMapping()
{
  PrefixMapping pmap = new PrefixMappingImpl() ;
  for ( Node gn : graphs )
  {
    if ( ! gn.isURI() ) continue ;
    Graph g = dataset.getGraph(gn) ;
    PrefixMapping pmapNamedGraph = g.getPrefixMapping() ;
    pmap.setNsPrefixes(pmapNamedGraph) ;
  }
  return pmap ;
}

相关文章