當前位置: 首頁>>代碼示例>>Java>>正文


Java Resource.addLiteral方法代碼示例

本文整理匯總了Java中com.hp.hpl.jena.rdf.model.Resource.addLiteral方法的典型用法代碼示例。如果您正苦於以下問題:Java Resource.addLiteral方法的具體用法?Java Resource.addLiteral怎麽用?Java Resource.addLiteral使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hp.hpl.jena.rdf.model.Resource的用法示例。


在下文中一共展示了Resource.addLiteral方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSupervisorOrganization

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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,代碼行數:33,代碼來源:MonthlyRdfActions.java

示例2: addQualityReport

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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

示例3: addDimensions

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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

示例4: addTechniques

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
private static void addTechniques(Model model) {

        Resource uriCountAssessmentTechnique = model.createResource(LDQM.AT_SPARQL_Query.getURI());
        uriCountAssessmentTechnique.addProperty(RDF.type, LDQ.AssessmentTechnique);
        uriCountAssessmentTechnique.addLiteral(LDQ.isSubjective, false);
        uriCountAssessmentTechnique.addProperty(LDQ.hasAutomationLevel, LDQ.Automatic);
        uriCountAssessmentTechnique.addLiteral(DC.description, model.createLiteral("Distinct IRI counts for a given RDF graph are calculated " +
                "with a SPARQL query. This technique is used to count distinct iris, subjects, predicates, objects, etc.", "en"));

        Resource assessmentTechnique = model.createResource(LDQM.AT_Url_Dereferencing.getURI());
        assessmentTechnique.addProperty(RDF.type, LDQ.AssessmentTechnique);
        assessmentTechnique.addLiteral(LDQ.isSubjective, false);
        assessmentTechnique.addProperty(LDQ.hasAutomationLevel, LDQ.Automatic);
        assessmentTechnique.addLiteral(DC.description, model.createLiteral("Each URI is dereferenced using the HTTP HEAD method, and if fails " +
                "using the HTTP GET method. Resources with 2XX responses (after redirection) are considered dereferenceable.", "en"));

    }
 
開發者ID:nandana,項目名稱:ld-sniffer,代碼行數:18,代碼來源:Executor.java

示例5: addFekTypeIsuesToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
/**
    * Add to the model the Resources that contain the Fek Type Issues as retrieved from the respective dictionary
    * 
    * @param Model the model we are currently working with
    * @param DictionaryItems the Fek Type Issues as retrieved from the respective dictionary
    */
public void addFekTypeIsuesToModel(Model model, DictionaryItems fekTypesList) {
	
	for (DictionaryItem item : fekTypesList.getItems()) {
		Resource fekTypeResource = model.createResource(Ontology.instancePrefix + "FekType/" + item.getUid(), Ontology.fekTypeResource);
		fekTypeResource.addLiteral(Ontology.fekTypeId, item.getUid());
		fekTypeResource.addProperty(Ontology.prefLabel, item.getLabel(), "el");
       }
	
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:16,代碼來源:MonthlyRdfActions.java

示例6: addCountriesToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
/**
    * Add to the model the Resources that contain the Countries as retrieved from the respective dictionary
    * 
    * @param Model the model we are currently working with
    * @param DictionaryItems the countries as retrieved from the respective dictionary
    */
public void addCountriesToModel(Model model, DictionaryItems countryList) {
	
	for (DictionaryItem item : countryList.getItems()) {
		Resource fekTypeResource = model.createResource(Ontology.instancePrefix + "Country/" + item.getUid(), Ontology.countryResource);
		String[] countryDtls = countries.findCountryFromAbbreviation(item.getUid());
		fekTypeResource.addLiteral(Ontology.countryId, item.getUid());
		fekTypeResource.addProperty(Ontology.prefLabel, countryDtls[0], "el");
		fekTypeResource.addProperty(Ontology.prefLabel, countryDtls[1], "en");
       }
	
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:18,代碼來源:MonthlyRdfActions.java

示例7: addCurrenciesToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
/**
    * Add to the model the Resources that contain the Currencies as retrieved from the respective dictionary
    * 
    * @param Model the model we are currently working with
    * @param DictionaryItems the currencies as retrieved from the respective dictionary
    */
public void addCurrenciesToModel(Model model, DictionaryItems currencyList) {
	
	for (DictionaryItem item : currencyList.getItems()) {
		Resource fekTypeResource = model.createResource(Ontology.instancePrefix + "Currency/" + item.getUid(), Ontology.currencyResource);
		String[] currencyDtls = countries.findCurrencyFromAbbreviation(item.getUid());
		fekTypeResource.addLiteral(Ontology.currencyId, item.getUid());
		fekTypeResource.addProperty(Ontology.prefLabel, currencyDtls[0], "el");
		fekTypeResource.addProperty(Ontology.prefLabel, currencyDtls[1], "en");
       }
	
}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:18,代碼來源:MonthlyRdfActions.java

示例8: addOrganizationUnitToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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,代碼行數:36,代碼來源:MonthlyRdfActions.java

示例9: addFekTypeIsuesToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
/**
 * Add to the model the Resources that contain the Fek Type Issues as
 * retrieved from the respective dictionary
 * 
 * @param Model
 *            the model we are currently working with
 * @param DictionaryItems
 *            the Fek Type Issues as retrieved from the respective
 *            dictionary
 */
public void addFekTypeIsuesToModel(Model model, DictionaryItems fekTypesList) {

	for (DictionaryItem item : fekTypesList.getItems()) {
		Resource fekTypeResource = model.createResource(Ontology.instancePrefix + "FekType/" + item.getUid(),
				Ontology.fekTypeResource);
		fekTypeResource.addLiteral(Ontology.fekTypeId, item.getUid());
		fekTypeResource.addProperty(Ontology.prefLabel, item.getLabel(), "el");
	}

}
 
開發者ID:YourDataStories,項目名稱:harvesters,代碼行數:21,代碼來源:MonthlyRdfActions.java

示例10: addOrganizationUnitToModel

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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

示例11: createSupervisorOrganization

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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

示例12: addDereferenceabilityMeasure

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public void addDereferenceabilityMeasure(Model model, HttpResponse response) {
    Resource subject = model.createResource(response.getUri());
    try {
        subject.addProperty(URI4URI.host, new URI(response.getUri()).getHost());
    } catch (URISyntaxException e) {
        //We quietly ignore if we can't parse the URI
    }
    Resource measure = addMeasure(model, LDQM.IRIdereferenceability, subject);
    if (response.getStatusCode() >= 200 && response.getStatusCode() < 300 ) {
        measure.addLiteral(DQV.value, model.createTypedLiteral(true, XSDDatatype.XSDboolean));
        measure.addLiteral(EVAL.hasLiteralValue, model.createTypedLiteral(true, XSDDatatype.XSDboolean));
    } else {
        measure.addLiteral(DQV.value, model.createTypedLiteral(false, XSDDatatype.XSDboolean));
        measure.addLiteral(EVAL.hasLiteralValue, model.createTypedLiteral(false, XSDDatatype.XSDboolean));
    }
    Resource request = model.createResource(HTTP.Request);
    measure.addProperty(DCTerms.references, request);
    request.addLiteral(HTTP.methodName, response.getMethod());
    request.addLiteral(HTTP.httpVersion, "1.1");
    request.addLiteral(DCTerms.date, model.createTypedLiteral(DATE_FORMAT.format(response.getDate()),XSDDatatype.XSDdateTime));

    Resource res = model.createResource(HTTP.Response);
    request.addProperty(HTTP.resp, res);
    if (response.getStatusCode() > 0) {
        res.addLiteral(HTTP.statusCodeValue, model.createTypedLiteral(response.getStatusCode(),XSDDatatype.XSDint));
    }
    if (response.getReason() != null){
        res.addLiteral(HTTP.reasonPhrase, response.getReason());
    }
}
 
開發者ID:nandana,項目名稱:ld-sniffer,代碼行數:31,代碼來源:Evaluation.java

示例13: addMeasure

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public Resource addMeasure(Model model, Resource metric, Resource subject) {
    Resource measure = model.createResource(LDQM.MEASURE_PREFIX + UUID.randomUUID().toString());
    measure.addProperty(RDF.type, DQV.QualityMeasurement);
    measure.addProperty(RDF.type, DAQ.Observation);
    measure.addProperty(RDF.type, EVAL.QualityValue);
    measure.addProperty(DQV.computedOn, subject);
    measure.addProperty(EVAL.obtainedFrom, evaluation);
    measure.addProperty(PROV.wasGeneratedBy, evaluation);
    measure.addProperty(DQV.isMeasurementOf, metric);
    measure.addProperty(EVAL.forMeasure,  metric);
    measure.addLiteral(DAQ.isEstimate, false);
    return measure;
}
 
開發者ID:nandana,項目名稱:ld-sniffer,代碼行數:14,代碼來源:Evaluation.java

示例14: QuantityParser

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public QuantityParser(){
		this.linemap=new HashMap<Long,IfcdocVO>();
		this.model=ModelFactory.createDefaultModel();
		model.setNsPrefix("ifcdoc",IFCDOC );
		model.setNsPrefix("qto",QTO);
		Resource base=model.createResource(QTO);
		base.addProperty(RDF.type, OWL.Ontology);
		base.addLiteral(DC.creator, "Chi Zhang");
		base.addLiteral(DC.date, "29-03-2016");
		base.addLiteral(DC.description, "This is a vocabulary for the official property sets from IFC 4 documentation. ");
        		
		model.setNsPrefix("ifcowl", IFCOWL);
		model.setNsPrefix("express",EXPRESS);
		model.setNsPrefix("rdfs",RDFS.getURI());
		model.setNsPrefix("rdf",RDF.getURI());
		model.setNsPrefix("xsd", XSD.getURI());
		model.setNsPrefix("schm", SCHM);
		model.setNsPrefix("sp", SP.BASE_URI+"#");
		model.setNsPrefix("spin", SPIN.BASE_URI+"#");
		model.setNsPrefix("spl", SPL.BASE_URI+"#");
        model.setNsPrefix("dc", DC.getURI());
        model.setNsPrefix("owl", OWL.getURI());
//	    ifcSchema.read("src/main/java/nl/tue/ddss/bimsparql/resource/IFC2X3_TC1.owl");
		groups=model.createProperty(IFCDOC,"groups");
		isGroupedBy=model.createProperty(IFCDOC,"isGroupedBy");

			InputStream in=getClass().getClassLoader().getResourceAsStream("IFC2X3_TC1.ttl");
			ifcSchema=ModelFactory.createDefaultModel();
			ifcSchema.read(in,null,"TTL");

		
	}
 
開發者ID:BenzclyZhang,項目名稱:BimSPARQL,代碼行數:33,代碼來源:QuantityParser.java

示例15: addScales

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的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


注:本文中的com.hp.hpl.jena.rdf.model.Resource.addLiteral方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。