當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。