Resource collectingSystem = ResourceFactory.createResource(
riNamespace + "CollectingSystem");
Resource community = ResourceFactory.createResource(
riNamespace + "Community");
Property identifier = ResourceFactory.createProperty(
riNamespace + "identifier");
Property hasDimension = ResourceFactory.createProperty(
riNamespace + "hasDimension");
Property hasScale = ResourceFactory.createProperty(
riNamespace + "hasScale");
Property name = ResourceFactory.createProperty(
riNamespace + "name");
Property uriFormat = ResourceFactory.createProperty(
riNamespace + "uriFormat");
Property homePage = ResourceFactory.createProperty(
riNamespace + "homePage");
Property hasCategory = ResourceFactory.createProperty(
riNamespace + "hasCategory");
Property hasReputationModel = ResourceFactory.createProperty(
riNamespace + "hasReputationModel");
Property reputationModule = ResourceFactory.createProperty(
riNamespace + "reputationModule");
Property mapsMetric = ResourceFactory.createProperty(
riNamespace + "mapsMetric");
Property importedCommunity = ResourceFactory.createProperty(
riNamespace + "importedCommunity");
Property importedMetric = ResourceFactory.createProperty(
riNamespace + "importedMetric");
Property collectsReputationBy = ResourceFactory.createProperty(
riNamespace + "collectsReputationBy");
Property metricTransformation = ResourceFactory.createProperty(
riNamespace + "metricTransformation");
Property trust = ResourceFactory.createProperty(
riNamespace + "trust");
Property importsFrom = ResourceFactory.createProperty(
riNamespace + "importsFrom");
addPropertiesAndResources();
for(Resource agent : resources) {
ResIterator iters = model.listResourcesWithProperty(RDF.type,agent);
if (iters.hasNext()) {
System.out.println("The database contains resource for:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
String resourceName = null;
if(resource.getLocalName() != null) {
resourceName = resource.getLocalName();
} else if(resource.getId() != null) {
if(resource.getId().getLabelString() != null) {
resourceName = resource.getId().getLabelString();
} else {
resourceName = resource.getId().toString();
}
} else if(resource.getURI() != null) {
resourceName = resource.getURI();
}
System.out.println(" " + resourceName+" class:"+resource.getClass());
NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
while(nodes.hasNext()) {
RDFNode node = nodes.nextNode();
if(node.isResource()) {
System.out.println(" type " + node.asResource().getURI());
}
}
StmtIterator stmtI = model.listStatements(resource, null, (RDFNode)null);
while(stmtI.hasNext()) {
Statement statement = stmtI.nextStatement();
System.out.println(" triple "+statement.getPredicate()+" - "+statement.getObject());
}
for(Property property : propertyAccount) {
StmtIterator stmtI1 = model.listStatements(resource, property, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
System.out.println(" OnlineAccount "+statement.getObject());
if(statement.getObject().isResource()) {
Resource onlineAccount = statement.getObject().asResource();
NodeIterator nodess = model.listObjectsOfProperty(onlineAccount, RDF.type);
while(nodess.hasNext()) {
RDFNode node = nodess.nextNode();
if(node.isResource()) {
System.out.println(" type " + node.asResource().getURI());
}
}
for(Property property2 : propertyAccountName) {
StmtIterator stmtI2 = model.listStatements(onlineAccount, property2, (RDFNode)null);
Statement statement2 = stmtI2.nextStatement();
System.out.println(" AccountName "+statement2.getObject());
}
for(Property property2 : propertyAccountProfile) {
StmtIterator stmtI2 = model.listStatements(onlineAccount, property2, (RDFNode)null);
Statement statement2 = stmtI2.nextStatement();
System.out.println(" AccountProfile "+statement2.getObject());
}
}
}
}
}
}
}
ResIterator iters = model.listSubjectsWithProperty(RDF.type,dimension);
if (iters.hasNext()) {
System.out.println("The database contains subjects of type dimension:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+Dimension were found in the database");
}
iters = model.listResourcesWithProperty(RDF.type,categoryMatching);
if (iters.hasNext()) {
System.out.println("The database contains resources of type CategoryMatching:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String "+riNamespace+
"CategoryMatching were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,fixedCommunitiesTrust);
if (iters.hasNext()) {
System.out.println("The database contains resources of type fixedCommunitiesTrust:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"FixedCommunitiesTrust were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,trustBetweenCommunities);
if (iters.hasNext()) {
System.out.println("The database contains resources of type trustBetweenCommunities:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"trustBetweenCommunities were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,correlationBetweenDimension);
if (iters.hasNext()) {
System.out.println("The database contains resources of type CorrelationBetweenDimension:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"CorrelationBetweenDimension were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,logaritmicNumericTransformer);
if (iters.hasNext()) {
System.out.println("The database contains resources of type LogaritmicNumericTransformer:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"LogaritmicNumericTransformer were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,linealNumericTransformer);
if (iters.hasNext()) {
System.out.println("The database contains resources of type linealNumericTransformer:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"linealNumericTransformer were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,sqrtNumericTransformer);
if (iters.hasNext()) {
System.out.println("The database contains resources of type SqrtNumericTransformer:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
}
} else {
System.out.println("No simple String riNamespace+" +
"SqrtNumericTransformer were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,metric);
if (iters.hasNext()) {
System.out.println("The database contains resources of type metric:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
/* identifier */
StmtIterator stmtI1 = model.listStatements(resource, identifier, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" identifier:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" identifier resource " +
"impossible:"+statement.getObject());
} else {
System.out.println(" identifier no literal no resource");
}
}
/* hasDimension */
stmtI1 = model.listStatements(resource, hasDimension, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" hasDimension impossible:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" hasDimension resource:"+statement.getObject());
Resource dimResource = statement.getObject().asResource();
StmtIterator stmtI2 = model.listStatements(dimResource,
(Property)null, (RDFNode)null);
while(stmtI2.hasNext()) {
Statement statement2 = stmtI2.nextStatement();
System.out.println(" "+statement2.getPredicate().getLocalName()
+" "+statement2.getObject());
}
} else {
System.out.println(" hasDimension no literal no resource");
}
}
/* hasScale */
stmtI1 = model.listStatements(resource, hasScale, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" hasScale impossible:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" hasScale resource:"+statement.getObject());
Resource scaResource = statement.getObject().asResource();
StmtIterator stmtI2 = model.listStatements(scaResource,
(Property)null, (RDFNode)null);
while(stmtI2.hasNext()) {
Statement statement2 = stmtI2.nextStatement();
System.out.println(" "+statement2.getPredicate().getLocalName()
+" "+statement2.getObject());
}
} else {
System.out.println(" hasScale no literal no resource");
}
}
}
} else {
System.out.println("No simple String riNamespace+" +
"metric were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,collectingSystem);
if (iters.hasNext()) {
System.out.println("The database contains resources of type collectingSystem:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
/* name */
StmtIterator stmtI1 = model.listStatements(resource, name, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" name:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" name resource " +
"impossible:"+statement.getObject());
} else {
System.out.println(" name no literal no resource");
}
}
/* uriFormat */
stmtI1 = model.listStatements(resource, uriFormat, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" uriFormat:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" uriFormat resource impossible:"
+statement.getObject());
} else {
System.out.println(" uriFormat no literal no resource");
}
}
}
} else {
System.out.println("No simple String riNamespace+" +
"collectingSystem were found in the database");
}
iters = model.listSubjectsWithProperty(RDF.type,community);
if (iters.hasNext()) {
System.out.println("The database contains resources of type community:");
while (iters.hasNext()) {
Resource resource = iters.nextResource();
System.out.println(" " + resource.getLocalName());
/* identifier */
StmtIterator stmtI1 = model.listStatements(resource, identifier, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" identifier:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" identifier resource " +
"impossible:"+statement.getObject());
} else {
System.out.println(" identifier no literal no resource");
}
}
/* homePage */
stmtI1 = model.listStatements(resource, homePage, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" homePage:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" homePage resource " +
"impossible:"+statement.getObject());
} else {
System.out.println(" homePage no literal no resource");
}
}
/* hasCategory */
stmtI1 = model.listStatements(resource, hasCategory, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" hasCategory impossible:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" hasCategory resource:"
+statement.getObject());
Resource catResource = statement.getObject().asResource();
StmtIterator stmtI2 = model.listStatements(catResource,
(Property)null, (RDFNode)null);
while(stmtI2.hasNext()) {
Statement statement2 = stmtI2.nextStatement();
System.out.println(" "+statement2.getPredicate().getLocalName()
+" "+statement2.getObject());
}
} else {
System.out.println(" hasCategory no literal no resource");
}
}
/* hasReputationModel */
stmtI1 = model.listStatements(resource, hasReputationModel, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
if(statement.getObject().isLiteral()) {
System.out.println(" hasReputationModel impossible:"+statement.getObject());
} else if(statement.getObject().isResource()) {
System.out.println(" hasReputationModel resource:"
+statement.getObject());
Resource repResource = statement.getObject().asResource();
StmtIterator stmtI2 = model.listStatements(repResource,
(Property)null, (RDFNode)null);
while(stmtI2.hasNext()) {
Statement statement2 = stmtI2.nextStatement();
if(reputationModule.getURI().equalsIgnoreCase(
statement2.getPredicate().getURI())) {
System.out.println(" "+reputationModule.getURI()+" property "
+statement2.getObject());
Resource modResource = statement2.getObject().asResource();
StmtIterator stmtI3 = model.listStatements(modResource,
(Property)null, (RDFNode)null);
while(stmtI3.hasNext()) {
Statement statement3 = stmtI3.nextStatement();
if(statement3.getObject().isLiteral()) {
System.out.println(" "+statement3.getPredicate().getLocalName()
+":"+statement3.getObject());
} else if(statement3.getObject().isResource()) {
System.out.println(" "+statement3.getPredicate().getLocalName()
+" resource:"+statement3.getObject());
Resource anyResource = statement3.getObject().asResource();
StmtIterator stmtI4 = model.listStatements(anyResource,
(Property)null, (RDFNode)null);
if(mapsMetric.getURI().equalsIgnoreCase(
statement3.getPredicate().getURI())) {
} else if(importsFrom.getURI().equalsIgnoreCase(
statement3.getPredicate().getURI())) {
while(stmtI4.hasNext()) {
Statement statement4 = stmtI4.nextStatement();
if(importedCommunity.getURI().equals(statement4.getPredicate().getURI())) {
if(statement4.getObject().isLiteral()) {