Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

pipeExist-method #27

Open
retog opened this issue Mar 4, 2014 · 0 comments
Open

pipeExist-method #27

retog opened this issue Mar 4, 2014 · 0 comments
Assignees

Comments

@retog
Copy link
Contributor

retog commented Mar 4, 2014

Currently in SourcingAdmin:

private boolean pipeExists(UriRef pipeRef) {
    boolean result = false;

    if (pipeRef != null) {
        GraphNode pipeNode = new GraphNode(pipeRef, getDlcGraph());
        if(pipeNode != null) {
            result = true;
        }
    }

    return result;

}

This is the same as:

private boolean pipeExists(UriRef pipeRef) {
   return pipreRef != null;
}

But probably what you want is something like

private boolean pipeExists(UriRef pipeRef) {
    boolean result = false;        
    if (pipeRef != null) {
        GraphNode pipeNode = new GraphNode(pipeRef, getDlcGraph());
        result = pipeNode.hasProperty(RDF.type, Ontology.Pipe);
    }
    return result;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants