Package es.urjc.escet.semium.jenaextensions

Examples of es.urjc.escet.semium.jenaextensions.ResourceSelector


                   
                    while(!resourceIsUnique){
                        String tmpValue = value.replace("@newID@",Long.toString(++lastID));
                        res = model.createResource(tmpValue);
                        //Check if Namespace is already in use:
                        ResourceSelector rSel = new ResourceSelector(res);
                        StmtIterator stmtIt = model.listStatements(rSel);
                        if(!stmtIt.hasNext())
                            resourceIsUnique = true;
                    }
                } else{
                    res = model.createResource(value);
                    ResourceSelector rSel = new ResourceSelector(res);
                    StmtIterator stmtIt = model.listStatements(rSel);
                    if(stmtIt.hasNext())
                        //Resource exist, cancel operation
                        throw new ImporterException("Resource '" + value + "' already exists");
                }
View Full Code Here


   
    public static void deleteStatements(Model model, Resource res){
        StmtIterator stmtIterator = null;
       
        //Delete all statements, that contain the resource in their subject
        ResourceSelector resSelector = new ResourceSelector(res);
        stmtIterator = model.listStatements(resSelector);
        model.remove(stmtIterator);
       
        //Delete all statements, that contain the resource in their object
        StatementSelector stmtSelector = new StatementSelector(null,null,res);
View Full Code Here

TOP

Related Classes of es.urjc.escet.semium.jenaextensions.ResourceSelector

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.