Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.apache.marmotta.platform.core.api.triplestore;
 
 import java.util.List;
 import java.util.Set;
 
The context (named graphs in LMF, formerly "knowledge space" in KiWi) service offers convenience functions for working with LMF Contexts. Low level manipulation of contexts is offered by TripleStore.

A context or (other name) named graph represent a own graph for a separation of the whole data in the context. In other words: the relationship between triples and a context is a 1 to N relationship. Every triple is though the context connect to exactly one context.

Every context has own access rights, triples, reasoning rules and other metadata.

You can create contexts for user, for imported ontologies, own created content, inferred triples and system data

every new triple without information of a context is connect with the context to the default context

Author(s):
Stefan
Sergio Fernández
 
 public interface ContextService {
 
     static final String DEFAULT_PREFIX = "context";
     
     //****************************************
     // get/create default, inferred
     //****************************************
 
    
Get the base context URI

Returns:
base context
 
     String getBaseContext();

    
Return the set of contexts that is currently active for reading. The set of active contexts is either selected explicitly in web service calls or it consists of all contexts.

Returns:
a set of URIs indicating the active contexts
 
     Set<URIgetActiveContext();

    
Return the context used for storing system information.

Returns:
a URI representing the system context
Throws:
java.net.URISyntaxException
 
     URI getSystemContext() throws URISyntaxException;

    
Get the uri of the inferred context

Returns:
uri of this inferred context
Throws:
java.net.URISyntaxException
 
     URI getInferredContext() throws URISyntaxException;

    
Get the uri of the default context

 
     URI getDefaultContext() throws URISyntaxException;

    
Get the uri of the context used for caching linked data

 
    URI getCacheContext() throws URISyntaxException;

    
List all contexts currently available

Returns:
    List<URIlistContexts();
    
    
List all accepted formats to ingest content

Returns:
    Set<StringgetAcceptFormats();
    
    
List all contexts currently available

Parameters:
filter filter only the contexts using the normative base uri
Returns:
    List<URIlistContexts(boolean filter);

    
Create a new context with the given URI or return the already existing context. Essentially just calls resourceService.createUriResource, but sets some resource parameters correctly.

Parameters:
uri the uri of the context to create
Returns:
a URI representing the created context
Throws:
java.net.URISyntaxException
    URI createContext(String urithrows URISyntaxException;

    
Create a new context with the given URI or return the already existing context. Essentially just calls resourceService.createUriResource, but sets some resource parameters correctly.

Parameters:
uri
label
Returns:
Throws:
java.net.URISyntaxException
    URI createContext(String uriString labelthrows URISyntaxException;

    
Return the context with the given URI if it exists.

Parameters:
context_uri
Returns:
    URI getContext(String context_uri);

    
Return a human-readable label for the context, either the rdfs:label or the last part of the URI.

Parameters:
context
Returns:
    String getContextLabel(URI context);

    
Return the number of triples for the context.

Parameters:
context
    long getContextSize(org.openrdf.model.URI context);
    
    
Import content into the context

Parameters:
context
is
format
Returns:
    boolean importContent(String contextInputStream isString format);

    
Remove (clean whole content) the context represented by this URI

Parameters:
context uri
Returns:
operation result, false if context does not exist
    boolean removeContext(String context);

    
Remove (clean whole content) the context represented by this resource

Parameters:
context resource
Returns:
operation result, false if context does not exist
    boolean removeContext(URI context);
New to GrepCode? Check out our FAQ X