src/main/java/SDOImport.java
public static Map<String, Integer> loadbuildMVersions(String resource, String endpoint, String master_graph) {
        Map<String, Integer> data = new HashMap<String, Integer>();
        try {
            String querystr = "";
            if (!resource.isEmpty()) {
                querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}";
            } else {
                querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version}}";
            }
            QueryEngineHTTP query = new QueryEngineHTTP(endpoint, querystr);
            ResultSet rst = query.execSelect();

            while (rst.hasNext()) {
                QuerySolution qs = rst.next();
                RDFNode resource_node = qs.get("?resource");
                RDFNode version_node = qs.get("?version");

                String resource_uri = "<" + resource_node.asResource().getURI() + ">";
                String version_uri = version_node.asResource().getURI();
                version_uri = version_uri.substring(version_uri.lastIndexOf("/") + 1);

                int version = Integer.valueOf(version_uri);
                if (!data.containsKey(resource_uri)) {
                    data.put(resource_uri, version);
                } else if (data.get(resource_uri) < version) {
                    data.put(resource_uri, version);
                }
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        return data;
    }
/**
     * Loads the set of buildM instances that match the resource URI (in case this is given). As a result we get the
     * resources, and their address locality, such that we can match them to the existing crawls.
     *
     * @param resource
     * @param endpoint
     * @return
     */
Loads the set of buildM instances that match the resource URI (in case this is given). As a result we get the
resources, and their address locality, such that we can match them to the existing crawls.

@param resource
@param endpoint
@return
Loads the set of buildM instances that match the resource URI ( in case this is given ) . As a result we get the resources and their address locality such that we can match them to the existing crawls . @param resource @param endpoint @return
public static Map<String, Integer> loadbuildMVersions(String resource, String endpoint, String master_graph) {
        Map<String, Integer> data = new HashMap<String, Integer>();
        try {
            String querystr = "";
            if (!resource.isEmpty()) {
                querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}";
            } else {
                querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version}}";
            }
            QueryEngineHTTP query = new QueryEngineHTTP(endpoint, querystr);
            ResultSet rst = query.execSelect();
            while (rst.hasNext()) {
                QuerySolution qs = rst.next();
                RDFNode resource_node = qs.get("?resource");
                RDFNode version_node = qs.get("?version");
                String resource_uri = "<" + resource_node.asResource().getURI() + ">";
                String version_uri = version_node.asResource().getURI();
                version_uri = version_uri.substring(version_uri.lastIndexOf("/") + 1);
                int version = Integer.valueOf(version_uri);
                if (!data.containsKey(resource_uri)) {
                    data.put(resource_uri, version);
                } else if (data.get(resource_uri) < version) {
                    data.put(resource_uri, version);
                }
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return data;
    }
public static Map < String , Integer > loadbuildMVersions ( String resource , String endpoint , String master_graph ) { Map < String , Integer > data = new HashMap < String , Integer > ( ) ; try { String querystr = "" ; if ( ! resource . isEmpty ( ) ) { querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}" ; } else { querystr = "SELECT ?resource ?version  WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildM/hasVersion> ?version}}" ; } QueryEngineHTTP query = new QueryEngineHTTP ( endpoint , querystr ) ; ResultSet rst = query . execSelect ( ) ; while ( rst . hasNext ( ) ) { QuerySolution qs = rst . next ( ) ; RDFNode resource_node = qs . get ( "?resource" ) ; RDFNode version_node = qs . get ( "?version" ) ; String resource_uri = "<" + resource_node . asResource ( ) . getURI ( ) + ">" ; String version_uri = version_node . asResource ( ) . getURI ( ) ; version_uri = version_uri . substring ( version_uri . lastIndexOf ( "/" ) + 1 ) ; int version = Integer . valueOf ( version_uri ) ; if ( ! data . containsKey ( resource_uri ) ) { data . put ( resource_uri , version ) ; } else if ( data . get ( resource_uri ) < version ) { data . put ( resource_uri , version ) ; } } } catch ( Exception e ) { System . out . println ( e . getMessage ( ) ) ; } return data ; }
Loads the set of buildM instances that match the resource URI (in case this is given).
Loads the set of buildM instances that match the resource URI ( in case this is given ) .