当前位置: 首页>>代码示例>>Java>>正文


Java Model.createResource方法代码示例

本文整理汇总了Java中com.hp.hpl.jena.rdf.model.Model.createResource方法的典型用法代码示例。如果您正苦于以下问题:Java Model.createResource方法的具体用法?Java Model.createResource怎么用?Java Model.createResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hp.hpl.jena.rdf.model.Model的用法示例。


在下文中一共展示了Model.createResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCollectiveKindToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the Collective Kinds.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addCollectiveKindToModel(Model model) {

	List<String> colKindList = Arrays.asList("Παύση - Αντικατάσταση μέλους", "Συγκρότηση",
			"Καθορισμός Αμοιβής – Αποζημίωσης");

	for (String colKind : colKindList) {
		String[] colKindDtls = hm.findCollectiveKindIndividual(colKind);
		/** collectiveKindResource **/
		Resource collectiveKindResource = model.createResource(colKindDtls[0], Ontology.collectiveKindResource);
		model.createResource(colKindDtls[0], Ontology.conceptResource);
		/** configure prefLabel **/
		collectiveKindResource.addProperty(Ontology.prefLabel, colKindDtls[1], "el");
		collectiveKindResource.addProperty(Ontology.prefLabel, colKindDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:23,代码来源:MonthlyRdfActions.java

示例2: addTimePeriodToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the Time Period.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addTimePeriodToModel(Model model) {

	List<String> timeList = Arrays.asList("Έτος", "ΝΟΕΜΒΡΙΟΣ", "ΟΚΤΩΒΡΙΟΣ", "Τρίμηνο");

	for (String time : timeList) {
		String[] timeDtls = hm.findTimePeriodIndividual(time);
		/** timeResource **/
		Resource timeResource = model.createResource(timeDtls[0], Ontology.timeResource);
		model.createResource(timeDtls[0], Ontology.conceptResource);
		/** configure prefLabel **/
		timeResource.addProperty(Ontology.prefLabel, timeDtls[1], "el");
		timeResource.addProperty(Ontology.prefLabel, timeDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:22,代码来源:MonthlyRdfActions.java

示例3: addBudgetTypeToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the budget types.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addBudgetTypeToModel(Model model) {

	List<String> budgetTypeList = Arrays.asList("Τακτικός Προϋπολογισμός", "Πρόγραμμα Δημοσίων Επενδύσεων",
			"Ίδια Έσοδα", "Συγχρηματοδοτούμενο Έργο");

	for (String budgetType : budgetTypeList) {
		String[] budgetDtls = hm.findBudgetTypeIndividual(budgetType);
		/** statusResource **/
		Resource statusResource = model.createResource(budgetDtls[0], Ontology.budgetCategoryResource);
		model.createResource(budgetDtls[0], Ontology.conceptResource);
		/** configure prefLabel **/
		statusResource.addProperty(Ontology.prefLabel, budgetDtls[1], "el");
		statusResource.addProperty(Ontology.prefLabel, budgetDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:23,代码来源:MonthlyRdfActions.java

示例4: addCollectiveTypeToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the Collective Types.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addCollectiveTypeToModel(Model model) {

	List<String> colTypeList = Arrays.asList("Συλλογικό όργανο Διοίκησης", "Επιτροπή", "Ομάδα εργασίας");

	for (String colType : colTypeList) {
		String[] colTypeDtls = hm.findCollectiveTypeIndividual(colType);
		/** collectiveTypeResource **/
		Resource collectiveTypeResource = model.createResource(colTypeDtls[0], Ontology.collectiveTypeResource);
		model.createResource(colTypeDtls[0], Ontology.conceptResource);
		/** configure prefLabel **/
		collectiveTypeResource.addProperty(Ontology.prefLabel, colTypeDtls[1], "el");
		collectiveTypeResource.addProperty(Ontology.prefLabel, colTypeDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:22,代码来源:MonthlyRdfActions.java

示例5: addQualityReport

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
public Resource addQualityReport(Model model) {
    Resource qualityReport = model.createResource(LDQM.QUALITY_REPORT_PREFIX + UUID.randomUUID().toString(),QPRO.QualityReport);
    qualityReport.addProperty(QPRO.computedOn, ResourceFactory.createTypedLiteral(DATE_FORMAT.format(new Date()), XSDDatatype.XSDdateTime));
    Resource noDerefSubjectsProblem = model.createResource(QPRO.QualityProblem);
    noDerefSubjectsProblem.addProperty(QPRO.isDescribedBy, LDQM.IRIdereferenceability);
    for (HttpResponse response : responseMap.values()) {
        if (response.getStatusCode() >= 300 || response.getStatusCode() < 200) {
            Resource errSubject = model.createResource(LDQM.Defect_UndereferenceableURI);
            errSubject.addProperty(DCTerms.subject,response.getUri());
            if (response.getStatusCode() > 0) {
                errSubject.addLiteral(HTTP.statusCodeValue, model.createTypedLiteral(response.getStatusCode(), XSDDatatype.XSDint));
            }
            errSubject.addLiteral(HTTP.methodName, response.getMethod());
            if (response.getReason() != null) {
                errSubject.addLiteral(HTTP.reasonPhrase, response.getReason());
            }
            noDerefSubjectsProblem.addProperty(QPRO.problematicThing, errSubject);
        }
    }
    qualityReport.addProperty(QPRO.hasProblem, noDerefSubjectsProblem);
    qualityReport.addProperty(PROV.wasGeneratedBy, evaluation);
    return qualityReport;
}
 
开发者ID:nandana,项目名称:ld-sniffer,代码行数:24,代码来源:Evaluation.java

示例6: doGet

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	D2RServer server = D2RServer.fromServletContext(getServletContext());
	server.checkMappingFileChanged();
	if (request.getPathInfo() == null) {
		new ModelResponse(classMapListModel(), request, response).serve();
		return;
	}
	String classMapName = request.getPathInfo().substring(1);
	Model resourceList = getClassMapLister().classMapInventory(classMapName);
	if (resourceList == null) {
		response.sendError(404, "Sorry, class map '" + classMapName + "' not found.");
		return;
	}
   	Resource classMap = resourceList.getResource(server.baseURI() + "all/" + classMapName);
   	Resource directory = resourceList.createResource(server.baseURI() + "all");
   	classMap.addProperty(RDFS.seeAlso, directory);
   	classMap.addProperty(RDFS.label, "List of all instances: " + classMapName);
   	directory.addProperty(RDFS.label, "D2R Server contents");
   	server.addDocumentMetadata(resourceList, classMap);
	new ModelResponse(resourceList, request, response).serve();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:22,代码来源:ClassMapServlet.java

示例7: addOrganizationStatusToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the organization statuses.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addOrganizationStatusToModel(Model model) {

	List<String> statusesList = Arrays.asList("Active", "Inactive", "Pending");

	for (String status : statusesList) {
		/** statusResource **/
		Resource statusResource = model.createResource(Ontology.instancePrefix + "OrganizationStatus/" + status,
				Ontology.organizationStatusResource);
		model.createResource(Ontology.instancePrefix + "OrganizationStatus/" + status, Ontology.conceptResource);
		/** configure prefLabel **/
		String[] statusDtls = hm.findOrganizationStatusDetails(status);
		statusResource.addProperty(Ontology.prefLabel, statusDtls[1], "el");
		statusResource.addProperty(Ontology.prefLabel, statusDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:23,代码来源:MonthlyRdfActions.java

示例8: addKanonistikiToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the Regular Acts.
 * 
 * @param Model
 *            the model we are currently working with
 */
public void addKanonistikiToModel(Model model) {

	List<String> regularList = Arrays.asList("Υπουργική Απόφαση",
			"Πράξη Γενικού Γραμματέα Αποκεντρωμένης Διοίκησης", "Πράξη Οργάνου Διοίκησης Ν.Π.Δ.Δ.",
			"Πράξη Οργάνου Διοίκησης ΟΤΑ Α’ και Β’ Βαθμού (και εποπτευόμενων φορέων τους)",
			"Λοιπές Κανονιστικές Πράξεις");

	for (String regular : regularList) {
		String[] regularDtls = hm.findKanonistikiIndividual(regular);
		/** regulatoryResource **/
		Resource regularResource = model.createResource(regularDtls[0], Ontology.regulatoryActResource);
		model.createResource(regularDtls[0], Ontology.conceptResource);
		/** configure prefLabel **/
		regularResource.addProperty(Ontology.prefLabel, regularDtls[1], "el");
		regularResource.addProperty(Ontology.prefLabel, regularDtls[2], "en");
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:25,代码来源:MonthlyRdfActions.java

示例9: addDimensions

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
private static void addDimensions(Model model) {

        Resource accessibilityDimension = model.createResource(LDQM.Dimension_Accessibility.getURI());
        accessibilityDimension.addProperty(RDF.type, QMO.QualityCharacteristic);
        accessibilityDimension.addProperty(RDF.type, DQV.Dimension);
        accessibilityDimension.addProperty(RDF.type, DAQ.Dimension);
        accessibilityDimension.addLiteral(DC.title,  model.createLiteral("Accessibility quality characteristic (dimension)", "en"));
        accessibilityDimension.addProperty(SKOS.prefLabel, model.createLiteral("Accessibility quality characteristic (dimension)", "en"));
        accessibilityDimension.addProperty(SKOS.definition, model.createLiteral("The degree to which data can be accessed in a specific context of use."));
        accessibilityDimension.addProperty(OWL.sameAs, model.createResource("http://www.diachron-fp7.eu/dqm#Accessibility"));

        accessibilityDimension.addProperty(QMO.isMeasuredWith, LDQM.Averageiridereferenceability);
        accessibilityDimension.addProperty(QMO.isMeasuredWith, LDQM.Averagesubjectdereferenceability);
        accessibilityDimension.addProperty(QMO.isMeasuredWith, LDQM.Averagepredicatedereferenceability);
        accessibilityDimension.addProperty(QMO.isMeasuredWith, LDQM.Averageobjectdereferenceability);

    }
 
开发者ID:nandana,项目名称:ld-sniffer,代码行数:18,代码来源:Executor.java

示例10: addScales

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
private static void addScales(Model model) {

        Resource ratioScale_0_100 = model.createResource("http://linkeddata.es/resource/ldqm/Scale/percentageHigherBest");
        ratioScale_0_100.addProperty(RDF.type, OM.Ratio_scale);
        ratioScale_0_100.addLiteral(QMO.hasLowerBoundary, 0);
        ratioScale_0_100.addLiteral(QMO.hasUpperBoundary, 100);
        ratioScale_0_100.addProperty(QMO.hasRankingFunction, QMO.Ranking_HigherBest);

        Resource ratioScale_0 = model.createResource("http://linkeddata.es/resource/ldqm/Scale/countHigherBest");
        ratioScale_0.addProperty(RDF.type, OM.Ratio_scale);
        ratioScale_0.addLiteral(QMO.hasLowerBoundary, 0);
        ratioScale_0.addProperty(QMO.hasRankingFunction, QMO.Ranking_HigherBest);

    }
 
开发者ID:nandana,项目名称:ld-sniffer,代码行数:15,代码来源:Executor.java

示例11: main

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
public static void main(String[] args) {
	// Load assembler specification from file
	Model assemblerSpec = FileManager.get().loadModel("doc/example/assembler.ttl");
	
	// Get the model resource
	Resource modelSpec = assemblerSpec.createResource(assemblerSpec.expandPrefix(":myModel"));
	
	// Assemble a model
	Model m = Assembler.general.openModel(modelSpec);
	
	// Write it to System.out
	m.write(System.out);

	m.close();
}
 
开发者ID:d2rq,项目名称:r2rml-kit,代码行数:16,代码来源:AssemblerExample.java

示例12: classMapListModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
private Model classMapListModel() {
	D2RServer server = D2RServer.fromServletContext(getServletContext());
	Model result = ModelFactory.createDefaultModel();
	Resource list = result.createResource(server.baseURI() + "all");
	list.addProperty(RDFS.label, "D2R Server contents");
	for (String classMapName: getClassMapLister().classMapNames()) {
		Resource instances = result.createResource(server.baseURI() + "all/" + classMapName);
		list.addProperty(RDFS.seeAlso, instances);
		instances.addProperty(RDFS.label, "List of all instances: " + classMapName);
	}
	server.addDocumentMetadata(result, list);
	return result;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:14,代码来源:ClassMapServlet.java

示例13: createFekResource

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the the Fek that is related to the Organization
 * 
 * @param Model
 *            the model we are currently working with
 * @param Resource
 *            the resource of the related organization
 * @param String
 *            the issue type of the Fek
 * @param String
 *            the year that Fek was published
 * @param String
 *            the number of the Fek
 */
private void createFekResource(Model model, Resource orgResource, String fekIssue, String fekYear, String fekNumber,
		boolean newOrganizationFlag) {

	String fekUriName = "";

	if ((fekIssue != null) && (fekIssue != "")) {
		fekUriName = fekIssue + "/" + fekYear + "/" + fekNumber;
	} else {
		fekUriName = fekYear + "/" + fekNumber;
	}

	Resource fekResource = model.getResource(Ontology.instancePrefix + "Fek/" + fekUriName);

	if (model.containsResource(fekResource)) { // if Fek resource exists use
												// it
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else { // ...else create it
		fekResource = model.createResource(Ontology.instancePrefix + "Fek/" + fekUriName, Ontology.fekResource);
		fekResource.addProperty(Ontology.fekNumber, fekNumber);
		fekResource.addProperty(Ontology.fekYear, fekYear);
		if ((fekIssue != null) && (fekIssue != "")) {
			fekResource.addProperty(Ontology.fekIssue,
					model.getResource(Ontology.instancePrefix + "FekType/" + fekIssue));
		}
	}

	/** Organization - FEK **/
	if (newOrganizationFlag) {
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else {
		orgResource.removeAll(Ontology.relatedFek); // delete the old
													// relationships
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:51,代码来源:MonthlyRdfActions.java

示例14: addOrganizationUnitToModel

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the the Organization Unit that is related to the
 * Organization
 * 
 * @param Model
 *            the model we are currently working with
 * @param Resource
 *            the resource of the related organization
 * @param Unit
 *            the list of the organization units
 */
private void addOrganizationUnitToModel(Model model, Resource orgResource, Units unitsList) {

	for (Unit unit : unitsList.getUnits()) {
		Resource orgUnitResource = model.createResource(
				Ontology.instancePrefix + "OrganizationalUnit/" + unit.getUid(),
				Ontology.organizationalUnitResource);
		orgUnitResource.addLiteral(Ontology.organizationUnitId, unit.getUid());
		// orgUnitResource.addLiteral(Ontology.organizationUnitActive,
		// unit.isActive());
		orgUnitResource.addProperty(RDFS.label, model.createLiteral(hm.cleanInputData(unit.getLabel()), "el"));

		if (unit.getAbbreviation() != null) {
			orgUnitResource.addLiteral(Ontology.organizationUnitAbbreviation, unit.getAbbreviation());
		}

		if ((unit.getCategory() != null) && (unit.getCategory() != "")) {
			orgUnitResource.addProperty(Ontology.hasOrgUnitCategory, model
					.getResource(Ontology.instancePrefix + "OrganizationalUnitCategory/" + unit.getCategory()));
		}

		if (unit.getUnitDomains() != null) {
			for (String unitDomain : unit.getUnitDomains()) {
				orgUnitResource.addProperty(Ontology.orgActivity,
						model.getResource(Ontology.instancePrefix + "OrganizationDomain/" + unitDomain));
			}
		}
		/** Organization - OrganizationalUnit **/
		orgResource.addProperty(Ontology.hasUnit, orgUnitResource);
		/** OrganizationalUnit - Organization **/
		orgUnitResource.addProperty(Ontology.unitOf, orgResource);
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:45,代码来源:MonthlyRdfActions.java

示例15: createSupervisorOrganization

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the supervisor of the current Organization
 * 
 * @param Model
 *            the model we are currently working with
 * @param Resource
 *            the current organization
 * @param Organization
 *            the supervisor of the organization
 */
private void createSupervisorOrganization(Model model, Resource orgResource, Organization supervisor) {

	Resource supervisorResource = model
			.getResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber());

	if (model.containsResource(supervisorResource)) {
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	} else {
		supervisorResource = model.createResource(
				Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.organizationResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.businessEntityResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.orgOrganizationResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.registeredOrganizationResource);

		if (supervisor.getVatNumber() != "") {
			supervisorResource.addLiteral(Ontology.vatId, supervisor.getVatNumber());
		} else {
			supervisorResource.addLiteral(Ontology.vatId, "Empty vatID");
		}

		supervisorResource.addLiteral(Ontology.organizationId, supervisor.getUid());

		/** organization - Supervisor **/
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:42,代码来源:MonthlyRdfActions.java


注:本文中的com.hp.hpl.jena.rdf.model.Model.createResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。