Namespace.register
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.openprovenance.prov.model.Namespace.register (Showing top 16 results out of 315)

origin: org.openprovenance.prov/prov-model

public void registerDefault(String namespace) {
register(null,namespace);
}
origin: lucmoreau/ProvToolbox

void register(QualifiedName name) {
if (name==null) return;
String namespace = name.getNamespaceURI();
String prefix = name.getPrefix();
if ((prefix == null) || (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX))) {
  ns.registerDefault(namespace);
} else {
  ns.register(prefix, namespace);
}
}
origin: org.openprovenance.prov/prov-model

/**
 * Extends this Namespace with all the prefix/namespace registration of the Namespace received as argument. 
 * @param ns the {@link Namespace} whose prefix/namespace registration are added to this {@link Namespace}.
 */
public void extendWith(Namespace ns) {
if (ns==null) return;
if (ns.getDefaultNamespace()!=null) {
  registerDefault(ns.getDefaultNamespace());
}
for (String prefix: ns.prefixes.keySet()) {
  register(prefix, ns.prefixes.get(prefix));
}
}
origin: lucmoreau/ProvToolbox

public void registerDefault(String namespace) {
register(null,namespace);
}
origin: org.openprovenance.prov/prov-model

void register(QualifiedName name) {
if (name==null) return;
String namespace = name.getNamespaceURI();
String prefix = name.getPrefix();
if ((prefix == null) || (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX))) {
  ns.registerDefault(namespace);
} else {
  ns.register(prefix, namespace);
}
}
origin: org.openprovenance.prov/prov-rdf

/**
 * RDFHandlerBase overrides
 */
@Override
public void handleNamespace(String prefix, String namespace) {
if (prefix.equals("")) {
  prefix = "def";
}
this.document.getNamespace().register(prefix, namespace);
//pFactory.setNamespaces(this.document.getNss());
//this.revnss.put(namespace, prefix);
}
origin: lucmoreau/ProvToolbox

/**
 * Extends this Namespace with all the prefix/namespace registration of the Namespace received as argument. 
 * @param ns the {@link Namespace} whose prefix/namespace registration are added to this {@link Namespace}.
 */
public void extendWith(Namespace ns) {
if (ns==null) return;
if (ns.getDefaultNamespace()!=null) {
  registerDefault(ns.getDefaultNamespace());
}
for (String prefix: ns.prefixes.keySet()) {
  register(prefix, ns.prefixes.get(prefix));
}
}
origin: lucmoreau/ProvToolbox

/**
 * RDFHandlerBase overrides
 */
@Override
public void handleNamespace(String prefix, String namespace) {
if (prefix.equals("")) {
  prefix = "def";
}
this.document.getNamespace().register(prefix, namespace);
//pFactory.setNamespaces(this.document.getNss());
//this.revnss.put(namespace, prefix);
}
origin: org.openprovenance.prov/prov-json

private Namespace decodePrefixes(JsonObject bundleStructure) {
Namespace ns = new Namespace();
// prefixes prov and xsd are implicit in prov-json
ns.addKnownNamespaces();
JsonObject prefixes = getObjectAndRemove(bundleStructure,
           PROV_JSON_PREFIX);
if (prefixes != null) {
  for (Map.Entry<String, JsonElement> pair : prefixes.entrySet()) {
  String prefix = pair.getKey();
  String uri = pair.getValue().getAsString();
  if (prefix.equals("default")) {
    ns.registerDefault(uri);
  } else {
    ns.register(prefix, uri);
  }
  }
}
return ns;
}
origin: lucmoreau/ProvToolbox

/**
 * @return the suite of tests being tested
 */
public void updateNamespaces(Document doc) {
  Namespace ns = Namespace.gatherNamespaces(doc);
  ns.register("provext", "http://openprovenance.org/prov/extension#");
  doc.setNamespace(ns);
}
origin: lucmoreau/ProvToolbox

private Namespace decodePrefixes(JsonObject bundleStructure) {
Namespace ns = new Namespace();
// prefixes prov and xsd are implicit in prov-json
ns.addKnownNamespaces();
JsonObject prefixes = getObjectAndRemove(bundleStructure,
           PROV_JSON_PREFIX);
if (prefixes != null) {
  for (Map.Entry<String, JsonElement> pair : prefixes.entrySet()) {
  String prefix = pair.getKey();
  String uri = pair.getValue().getAsString();
  if (prefix.equals("default")) {
    ns.registerDefault(uri);
  } else {
    ns.register(prefix, uri);
  }
  }
}
return ns;
}
origin: lucmoreau/ProvToolbox

public void addSeed(Document doc, long seed, String name) {
  Namespace namespace = doc.getNamespace();
  QualifiedName qn = namespace.stringToQualifiedName(name, pf);
  for (StatementOrBundle statement : doc.getStatementOrBundle()) {
    if (statement instanceof Identifiable) {
      Identifiable ss = (Identifiable) statement;
      if ((ss.getId() != null) && (ss.getId().equals(qn))) {
        namespace.register(TERM_PREFIX, TERM_NS);
        namespace.addKnownNamespaces();
        ((HasOther) ss).getOther()
            .add(pf.newOther(TERM_NS, "seed", TERM_PREFIX,
                     seed, pf.getName().XSD_LONG));
        return;
      }
    }
  }
}
origin: org.openprovenance.prov/prov-n

String iri1=unwrap(getTokenString(ast.getChild(1)));
if (pre!=null) { // should not occur
namespace.register(pre, iri1);
origin: org.openprovenance.prov/prov-rdf

ns.register(NamespacePrefixMapper.RDFS_PREFIX, NamespacePrefixMapper.RDFS_NS); // RDF
ns.register(NamespacePrefixMapper.RDF_PREFIX, NamespacePrefixMapper.RDF_NS); // RDF
origin: lucmoreau/ProvToolbox

String iri1=unwrap(getTokenString(ast.getChild(1)));
if (pre!=null) { // should not occur
namespace.register(pre, iri1);
origin: lucmoreau/ProvToolbox

ns.register(NamespacePrefixMapper.RDFS_PREFIX, NamespacePrefixMapper.RDFS_NS); // RDF
ns.register(NamespacePrefixMapper.RDF_PREFIX, NamespacePrefixMapper.RDF_NS); // RDF
org.openprovenance.prov.modelNamespaceregister

Popular methods of Namespace

  • <init>
  • withThreadNamespace
  • getDefaultNamespace
  • getPrefixes
  • gatherNamespaces
  • setParent
  • stringToQualifiedName
  • getNamespaces
  • addKnownNamespaces
  • qualifiedNameToString
  • registerDefault
  • extendWith
    Extends this Namespace with all the prefix/namespace registration of the Namespace received as argum
  • registerDefault,
  • extendWith,
  • getParent,
  • getThreadNamespace,
  • newPrefix,
  • qualifiedNameToStringWithNamespace,
  • setDefaultNamespace,
  • check,
  • qualifiedName

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Path (java.nio.file)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • JLabel (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)