• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FOAF类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.jena.sparql.vocabulary.FOAF的典型用法代码示例。如果您正苦于以下问题:Java FOAF类的具体用法?Java FOAF怎么用?Java FOAF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FOAF类属于org.apache.jena.sparql.vocabulary包,在下文中一共展示了FOAF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public void create(Model model) {

		Property id = model
				.createProperty("http://www.ontologydesignpatterns.org/ont/eswc/ontology.owl#eswcId");

		String sparql = "SELECT ?person " + "WHERE{?person a <" + FOAF.Person
				+ ">}";
		Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
		QueryExecution queryExecution = QueryExecutionFactory.create(query,
				model);

		ResultSet resultSet = queryExecution.execSelect();
		for (int i = 1; resultSet.hasNext(); i++) {
			QuerySolution solution = resultSet.next();
			Resource person = solution.getResource("person");
			person.addLiteral(id,
					model.createTypedLiteral(i, XSDDatatype.XSDpositiveInteger));
		}
	}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:20,代码来源:AppIDCreator.java


示例2: list

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public void list(Model model) {
	String sparql = "PREFIX foaf: <" + FOAF.NS + "> "
			+ "SELECT ?lastName ?person " + "WHERE{ "
			+ "    ?person a foaf:Person . "
			+ "    ?person foaf:lastName ?lastName . "
			+ "    ?person1 a foaf:Person . "
			+ "    ?person1 foaf:lastName ?lastName1 . "
			+ "    FILTER(?person != ?person1) . "
			+ "    FILTER(STR(?lastName) = STR(?lastName1)) . " + "}"
			+ "ORDER BY ?lastName";
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query,
			model);

	ResultSet resultSet = queryExecution.execSelect();
	ResultSetFormatter.out(System.out, resultSet);
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:18,代码来源:DuplicatePerson.java


示例3: buildRDF

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
@Override
public Model buildRDF(File directory) {
	Model modelout = ModelFactory.createDefaultModel();
	Model model = ModelFactory.createDefaultModel();

	try {
		model.read(new FileInputStream(directory), null, "RDF/XML");
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

	if (!model.isEmpty()) {
		String sparql = "PREFIX foaf: <" + FOAF.NS + "> "
				+ "CONSTRUCT {?author foaf:depiction ?depiction} "
				+ "WHERE{?author foaf:depiction ?depiction}";

		Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
		QueryExecution queryExecution = QueryExecutionFactory.create(query,
				model);
		modelout = queryExecution.execConstruct();
	}
	return modelout;
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:25,代码来源:DepictionGraphBuilder.java


示例4: getDepictionList

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
protected Set<String> getDepictionList(Model model) {

		Set<String> depictions = new HashSet<String>();
		String sparql = "PREFIX foaf: <" + FOAF.NS + "> "
				+ "SELECT ?depiction "
				+ "WHERE{?author foaf:depiction ?depiction}";

		Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
		QueryExecution queryExecution = QueryExecutionFactory.create(query,
				model);
		ResultSet resultSet = queryExecution.execSelect();

		while (resultSet.hasNext()) {
			depictions.add(resultSet.next().get("depiction").toString());
		}

		return depictions;
	}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:19,代码来源:DepictionGraphBuilder.java


示例5: checkRegistration

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
 * Check the ability to register in various places
 */
protected void checkRegistration() {
    testFor("bob").source("test/absolute-black.ttl").post(BASE_URL + "secure/reg2/colours").checkRejected();
    testFor("bob").source("test/reg1.ttl").post(BASE_URL + "secure/reg2").checkRejected();
    testFor("bob").source("test/absolute-black.ttl").post(BASE_URL + "secure/reg1/colours").checkAccepted();
    Model m = testFor("bob").get(BASE_URL + "secure/reg1/colours/_black").checkAccepted().getModel();
    Resource item = m.getResource(ROOT_REGISTER + "secure/reg1/colours/_black");
    Resource submitter = item.getPropertyResourceValue(RegistryVocab.submitter);
    assertNotNull(submitter);
    assertEquals("Bob", RDFUtil.getStringValue(submitter, FOAF.name));

    testFor("bob").source("test/reg1.ttl").post(BASE_URL + "secure").checkRejected();
    testFor("bob").source("test/reg1.ttl").post(BASE_URL + "secure/reg1").checkAccepted();

    testFor("alice").source("test/reg1.ttl").post(BASE_URL).checkRejected();
    testFor("alice").source("test/reg1.ttl").post(BASE_URL + "secure/reg2").checkAccepted();


    testFor("admin").source("test/reg1.ttl").post(BASE_URL).checkAccepted();
}
 
开发者ID:UKGovLD,项目名称:registry-core,代码行数:23,代码来源:TestSecurity.java


示例6: post

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
    * Handles POST method, stores the submitted RDF model in the specified named graph of the specified SPARQL endpoint, and returns response.
    * 
    * @param infModel the RDF payload
    * @param graphURI target graph name
    * @return response
    */
   public Response post(InfModel infModel, URI graphURI)
   {
if (infModel == null) throw new IllegalArgumentException("Model cannot be null");
if (log.isDebugEnabled()) log.debug("POSTed Model: {} to GRAPH URI: {}", infModel.getRawModel(), graphURI);

Resource created = getURIResource(infModel, RDF.type, FOAF.Document);
if (created == null)
{
    if (log.isDebugEnabled()) log.debug("POSTed Model does not contain statements with URI as subject and type '{}'", FOAF.Document.getURI());
    throw new WebApplicationException(Response.Status.BAD_REQUEST);
}

       UpdateRequest insertDataRequest;
if (graphURI != null) insertDataRequest = InsertDataBuilder.fromData(graphURI, infModel.getRawModel()).build();
else insertDataRequest = InsertDataBuilder.fromData(infModel.getRawModel()).build();

       insertDataRequest.setBaseURI(getUriInfo().getBaseUri().toString());
       if (log.isDebugEnabled()) log.debug("INSERT DATA request: {}", insertDataRequest);

       getSPARQLEndpoint().post(insertDataRequest, null, null);

URI createdURI = UriBuilder.fromUri(created.getURI()).build();
if (log.isDebugEnabled()) log.debug("Redirecting to POSTed Resource URI: {}", createdURI);
// http://stackoverflow.com/questions/3383725/post-redirect-get-prg-vs-meaningful-2xx-response-codes
// http://www.blackpepper.co.uk/posts/201-created-or-post-redirect-get/
//return Response.created(createdURI).entity(model).build();
return Response.seeOther(createdURI).build();
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:36,代码来源:ResourceBase.java


示例7: list

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public Collection<Organisation> list(){
	Collection<Organisation> organisationList = new ArrayList<Organisation>();

	StmtIterator stmtIterator = model.listStatements(null, RDF.type, FOAF.Organization);
	while(stmtIterator.hasNext()){
		Statement stmt = stmtIterator.next();
		Resource organisationResource = stmt.getSubject();
		Organisation organisation = new Organisation(organisationResource);
		organisationList.add(organisation);
	}
	return organisationList;
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:13,代码来源:Organisations.java


示例8: list

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public Collection<Person> list(){
	Collection<Person> personList = new ArrayList<Person>();

	StmtIterator stmtIterator = model.listStatements(null, RDF.type, FOAF.Person);
	while(stmtIterator.hasNext()){
		Statement stmt = stmtIterator.next();
		Resource personResource = stmt.getSubject();
		Person person = new Person(personResource);
		personList.add(person);
	}
	return personList;
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:13,代码来源:People.java


示例9: asConfResource

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public Resource asConfResource(Model model){
	String localName = resource.getLocalName();
	
	Resource organisation = model.createResource(ConferenceOntology.RESOURCE_NS + "organisation/" + localName);
	
	Model modelIn = resource.getModel();
	
	String sparql = 
			"CONSTRUCT {"
			+ "<" + organisation.getURI() + "> a <" + ConferenceOntology.Organisation.getURI() + "> . "
			+ "<" + organisation.getURI() + "> <" + RDFS.label + "> ?label . "
			+ "<" + organisation.getURI() + "> <" + ConferenceOntology.name + "> ?name . "
			+ "<" + organisation.getURI() + "> <" + OWL2.sameAs + "> <" + resource.getURI() + "> "
			+ "}"
			+ "WHERE{ "
			+ "<" + resource.getURI() + "> <" + RDFS.label + "> ?label . "
			+ "<" + resource.getURI() + "> <" + FOAF.name + "> ?name . "
			+ "OPTIONAL {<" + resource.getURI() + "> <" + FOAF.firstName + "> ?firstName}"
			+ "OPTIONAL {<" + resource.getURI() + "> <http://xmlns.com/foaf/0.1/lastName> ?lastName}"
			+ "OPTIONAL {<" + resource.getURI() + "> <" + FOAF.mbox_sha1sum + "> ?mbox_sha1sum}"
			+ "}";
	
	model.add(QueryExecutor.execConstruct(modelIn, sparql));
	
	return organisation;
	
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:28,代码来源:Organisation.java


示例10: remove

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public void remove(Model model, CSVReader csvReader) {
	String[] line = null;
	try {
		while ((line = csvReader.readNext()) != null) {
			String correct = line[0];
			String wrong = line[1];
			System.out.println(wrong);
			Resource correctPerson = model
					.getResource(ns.personNs + correct);
			Resource wrongPerson = model
					.getResource(ns.personNs + wrong);

			String sparql = "PREFIX foaf: <" + FOAF.NS + "> "
					+ "CONSTRUCT {" + "    <" + correctPerson
					+ "> ?outgoing ?val . " + "    ?obj ?ingoing <"
					+ correctPerson + "> . " + "} " + "WHERE{" + "    <"
					+ wrongPerson + "> ?outgoing ?val . "
					+ "    FILTER(isIRI(?val)) . " + "    ?obj ?ingoing <"
					+ wrongPerson + "> . " + "}";

			Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
			QueryExecution queryExecution = QueryExecutionFactory.create(
					query, model);

			Model m = queryExecution.execConstruct();

			model.add(m);

			model.removeAll(wrongPerson, null, (RDFNode) null);
			model.removeAll(null, null, wrongPerson);
		}
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:37,代码来源:DuplicatePerson.java


示例11: convertToSemanticWebDogFood

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public Model convertToSemanticWebDogFood(Model model) {

		/*
		 * Remove all the statements having as porperty one of the following
		 * predicate: * foaf:depiction; * dbpedia-owl:thumbnail; * foaf-mbox.
		 */

		Property dbpediaThumbnail = model
				.createProperty("http://dbpedia.org/ontology/thumbnail");
		Property swrcTmpId = model
				.createProperty("http://swrc.ontoware.org/ontology#id");
		Resource inUsePaperType = model
				.createResource("http://purl.org/spar/fabio/InUsePaper");
		Resource researchPaperType = model
				.createResource("http://purl.org/spar/fabio/ResearchPaper");
		Resource demoPaperType = model
				.createResource("http://purl.org/spar/fabio/DemoPaper");
		Resource posterPaperType = model
				.createResource("http://purl.org/spar/fabio/PosterPaper");
		model.removeAll(null, FOAF.depiction, (RDFNode) null);
		model.removeAll(null, FOAF.mbox, (RDFNode) null);
		model.removeAll(null, dbpediaThumbnail, (RDFNode) null);
		model.removeAll(null, swrcTmpId, (RDFNode) null);
		model.removeAll(null, RDF.type, inUsePaperType);
		model.removeAll(null, RDF.type, researchPaperType);

		return model;
	}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:29,代码来源:GenerateMainConferenceInitialGraph.java


示例12: main

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public static void main(String...argv)
{
    String filename = "data.ttl" ;

    // This is the heart of N-triples printing ... outoput is heavily buffered
    // so the FilterSinkRDF called flush at the end of parsing.
    Sink<Triple> output = new SinkTripleOutput(System.out, null, SyntaxLabels.createNodeToLabel()) ;
    StreamRDF filtered = new FilterSinkRDF(output, FOAF.name, FOAF.knows) ;
    
    // Call the parsing process. 
    RDFDataMgr.parse(filtered, filename) ;
}
 
开发者ID:xcurator,项目名称:xcurator,代码行数:13,代码来源:ExRIOT_4.java


示例13: createClassificationAndLevels

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
 * Creates in the model the resources representing the classification and its levels.
 */
	public void createClassificationAndLevels() {

	// Create the resource representing the classification (skos:ConceptScheme)
	scheme = model.createResource(BASE_URI + "sbi", SKOS.ConceptScheme);
	scheme.addProperty(SKOS.prefLabel, model.createLiteral("Dutch Standaard Bedrijfsindeling (SBI) 2008", "en")); // TODO Not really English
	scheme.addProperty(SKOS.notation, "SBI 2008"); // TODO What distinguishes annual versions?
	scheme.addProperty(SKOS.definition, model.createLiteral("The Standard Industrial Classification is a classification of economic activities designed by the Central Bureau of Statistics of the Netherlands (CBS) that aims to provide a uniform classification of the economy for the benefit of detailed economic analyzes and statistics.", "en"));
	scheme.addProperty(DC.publisher, model.createResource("http://www.cbs.nl"));
	scheme.addProperty(DCTerms.issued, model.createTypedLiteral("2008-01-01", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(DCTerms.modified, model.createTypedLiteral("2016-01-01", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(FOAF.homepage, model.createResource("https://www.cbs.nl/en-gb/our-services/methods/classifications/activiteiten/standard-industrial-classifications--dutch-sbi-2008-nace-and-isic--"));
	scheme.addProperty(XKOS.covers, model.createResource("http://eurovoc.europa.eu/5992"));
	scheme.addProperty(XKOS.numberOfLevels, model.createTypedLiteral(5));

	// Create the resources representing the levels (xkos:ClassificationLevel)
	Resource level1 = model.createResource(BASE_URI + "/sections", XKOS.ClassificationLevel);
	level1.addProperty(SKOS.prefLabel, model.createLiteral("SBI 2008 - level 1 - Sections", "en"));
	level1.addProperty(XKOS.depth, model.createTypedLiteral(1));
	level1.addProperty(XKOS.notationPattern, "[A-U]");
	level1.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sbi2008/section"));

	Resource level2 = model.createResource(BASE_URI + "/divisions", XKOS.ClassificationLevel);
	level2.addProperty(SKOS.prefLabel, model.createLiteral("SBI 2008 - level 2 - Divisions", "en"));
	level2.addProperty(XKOS.depth, model.createTypedLiteral(2));
	level2.addProperty(XKOS.notationPattern, "[0-9]{2}");
	level2.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sbi2008/division"));

	Resource level3 = model.createResource(BASE_URI + "/groups", XKOS.ClassificationLevel);
	level3.addProperty(SKOS.prefLabel, model.createLiteral("SBI 2008 - level 3 - Groups", "en"));
	level3.addProperty(XKOS.depth, model.createTypedLiteral(3));
	level3.addProperty(XKOS.notationPattern, "[0-9]{3}");
	level3.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sbi2008/group"));

	Resource level4 = model.createResource(BASE_URI + "/classes", XKOS.ClassificationLevel);
	level4.addProperty(SKOS.prefLabel, model.createLiteral("SBI 2008 - level 4 - Classes", "en"));
	level4.addProperty(XKOS.depth, model.createTypedLiteral(4));
	level4.addProperty(XKOS.notationPattern, "[0-9]{4}");
	level4.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sbi2008/class"));

	Resource level5 = model.createResource(BASE_URI + "/subclasses", XKOS.ClassificationLevel);
	level5.addProperty(SKOS.prefLabel, model.createLiteral("SBI 2008 - level 5 - Subclasses", "en"));
	level5.addProperty(XKOS.depth, model.createTypedLiteral(5));
	level5.addProperty(XKOS.notationPattern, "[0-9]{5}");
	level5.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sbi2008/subclass"));

	// Attach the level list to the classification
	levelList = model.createList(new RDFNode[] {level1, level2, level3, level4, level5});
	scheme.addProperty(XKOS.levels, levelList);
}
 
开发者ID:FranckCo,项目名称:Stamina,代码行数:53,代码来源:SBIModelMaker.java


示例14: createClassificationAndLevels

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
 * Creates in the model the resources representing the classification and its levels.
 */
	public void createClassificationAndLevels() {

	// Create the resource representing the classification (skos:ConceptScheme)
	scheme = model.createResource(SIC_BASE_URI + "sic", SKOS.ConceptScheme);
	scheme.addProperty(SKOS.prefLabel, model.createLiteral("UK Standard Industrial Classification of Economic Activities (SIC) 2007", "en"));
	scheme.addProperty(SKOS.notation, "UK SIC 2007");
	scheme.addProperty(SKOS.definition, model.createLiteral("The current Standard Industrial Classification (SIC) used in classifying business establishments and other statistical units by the type of economic activity in which they are engaged.", "en"));
	scheme.addProperty(DC.publisher, model.createResource("http://www.ons.gov.uk"));
	scheme.addProperty(DCTerms.issued, model.createTypedLiteral("2007-01-01", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(DCTerms.modified, model.createTypedLiteral("2007-01-01", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(FOAF.homepage, model.createResource("https://www.ons.gov.uk/methodology/classificationsandstandards/ukstandardindustrialclassificationofeconomicactivities/uksic2007"));
	scheme.addProperty(XKOS.covers, model.createResource("http://eurovoc.europa.eu/5992"));
	scheme.addProperty(XKOS.numberOfLevels, model.createTypedLiteral(5));

	// Create the resources representing the levels (xkos:ClassificationLevel)
	Resource level1 = model.createResource(SIC_BASE_URI + "/sections", XKOS.ClassificationLevel);
	level1.addProperty(SKOS.prefLabel, model.createLiteral("UK SIC 2007 - level 1 - Sections", "en"));
	level1.addProperty(XKOS.depth, model.createTypedLiteral(1));
	level1.addProperty(XKOS.notationPattern, "[A-U]");
	level1.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sic2007/section"));

	Resource level2 = model.createResource(SIC_BASE_URI + "/divisions", XKOS.ClassificationLevel);
	level2.addProperty(SKOS.prefLabel, model.createLiteral("UK SIC 2007 - level 2 - Divisions", "en"));
	level2.addProperty(XKOS.depth, model.createTypedLiteral(2));
	level2.addProperty(XKOS.notationPattern, "[0-9]{2}");
	level2.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sic2007/division"));

	Resource level3 = model.createResource(SIC_BASE_URI + "/groups", XKOS.ClassificationLevel);
	level3.addProperty(SKOS.prefLabel, model.createLiteral("UK SIC 2007 - level 3 - Groups", "en"));
	level3.addProperty(XKOS.depth, model.createTypedLiteral(3));
	level3.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]");
	level3.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sic2007/group"));

	Resource level4 = model.createResource(SIC_BASE_URI + "/classes", XKOS.ClassificationLevel);
	level4.addProperty(SKOS.prefLabel, model.createLiteral("UK SIC 2007 - level 4 - Classes", "en"));
	level4.addProperty(XKOS.depth, model.createTypedLiteral(4));
	level4.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]{2}");
	level4.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sic2007/class"));

	Resource level5 = model.createResource(SIC_BASE_URI + "/subclasses", XKOS.ClassificationLevel);
	level5.addProperty(SKOS.prefLabel, model.createLiteral("UK SIC 2007 - level 5 - Subclasses", "en"));
	level5.addProperty(XKOS.depth, model.createTypedLiteral(5));
	level5.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]{2}\\/[0-9]");
	level5.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/sic2007/subclass"));

	// Attach the level list to the classification
	levelList = model.createList(new RDFNode[] {level1, level2, level3, level4, level5});
	scheme.addProperty(XKOS.levels, levelList);
}
 
开发者ID:FranckCo,项目名称:Stamina,代码行数:53,代码来源:SICModelMaker.java


示例15: createClassificationAndLevels

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
 * Creates in the model the resources representing the classification and its levels.
 */
	public void createClassificationAndLevels() {

	// Create the resource representing the classification (skos:ConceptScheme)
	scheme = model.createResource(BASE_URI + "skd", SKOS.ConceptScheme);
	scheme.addProperty(SKOS.prefLabel, model.createLiteral("SKD_2008 - Standardna klasifikacija dejavnosti 2008, V2", "si"));
	scheme.addProperty(SKOS.prefLabel, model.createLiteral("SKD_2008 - Standard classification of activities 2008, V2", "en"));
	scheme.addProperty(SKOS.notation, "SKD 2008");
	scheme.addProperty(SKOS.definition, model.createLiteral("Standardna klasifikacija dejavnosti (SKD) je obvezen nacionalni standard, ki se uporablja za določanje dejavnosti in za razvrščanje poslovnih subjektov in njihovih delov za potrebe uradnih in drugih administrativnih zbirk podatkov (registri, evidence, podatkovne baze ipd.) ter za potrebe statistike in analitike v državi in na mednarodni ravni. Skladno s 6. členom Uredbe o SKD 2008 je za razlago vsebine postavk klasifikacije dejavnosti pristojen Statistični urad Republike Slovenije. Za razvrščanje enot Poslovnega registra Slovenije po dejavnosti je odgovorna Agencija Republike Slovenije za javnopravne evidence in storitve (AJPES).", "si"));
	scheme.addProperty(SKOS.definition, model.createLiteral("The Standard Classification of Activities (SKD) is the obligatory national standard used for defining the main activity and for classifying business entities and their units for the needs of official and other administrative data collections (registers, records, databases, etc.) and for the needs of national and international statistics and analyses. In line with Article 6 of the Decree on the 2008 Standard Classification of Activities, the Statistical Office of the Republic of Slovenia is authorised to explain the content of classification items. Classification of units of the Business Register of Slovenia by activity is the responsibility of the Agency of the Republic of Slovenia for Public Legal Records and Related Services (AJPES).", "en"));
	scheme.addProperty(DC.publisher, model.createResource("http://www.stat.si"));
	 // TODO Confirm creation date and obtain last modification date
	scheme.addProperty(DCTerms.issued, model.createTypedLiteral("2008-02-07", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(DCTerms.modified, model.createTypedLiteral("2008-02-07", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(FOAF.homepage, model.createResource("http://www.stat.si/klasje/tabela.aspx?cvn=5531"));
	scheme.addProperty(XKOS.covers, model.createResource("http://eurovoc.europa.eu/5992"));
	scheme.addProperty(XKOS.numberOfLevels, model.createTypedLiteral(5));

	// TODO: check the names of the levels
	// Create the resources representing the levels (xkos:ClassificationLevel)
	Resource level1 = model.createResource(BASE_URI + "/sections", XKOS.ClassificationLevel);
	level1.addProperty(SKOS.prefLabel, model.createLiteral("SKD 2008 - level 1 - Sections", "en"));
	level1.addProperty(XKOS.depth, model.createTypedLiteral(1));
	level1.addProperty(XKOS.notationPattern, "[A-U]");
	level1.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/skd2008/section"));

	Resource level2 = model.createResource(BASE_URI + "/divisions", XKOS.ClassificationLevel);
	level2.addProperty(SKOS.prefLabel, model.createLiteral("SKD 2008 - level 2 - Divisions", "en"));
	level2.addProperty(XKOS.depth, model.createTypedLiteral(2));
	level2.addProperty(XKOS.notationPattern, "[0-9]{2}");
	level2.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/skd2008/division"));

	Resource level3 = model.createResource(BASE_URI + "/groups", XKOS.ClassificationLevel);
	level3.addProperty(SKOS.prefLabel, model.createLiteral("SKD 2008 - level 3 - Groups", "en"));
	level3.addProperty(XKOS.depth, model.createTypedLiteral(3));
	level3.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]");
	level3.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/skd2008/group"));

	Resource level4 = model.createResource(BASE_URI + "/classes", XKOS.ClassificationLevel);
	level4.addProperty(SKOS.prefLabel, model.createLiteral("SKD 2008 - level 4 - Classes", "en"));
	level4.addProperty(XKOS.depth, model.createTypedLiteral(4));
	level4.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]{2}");
	level4.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/skd2008/class"));

	Resource level5 = model.createResource(BASE_URI + "/subclasses", XKOS.ClassificationLevel);
	level5.addProperty(SKOS.prefLabel, model.createLiteral("SKD 2008 - level 5 - Subclasses", "en"));
	level5.addProperty(XKOS.depth, model.createTypedLiteral(5));
	level5.addProperty(XKOS.notationPattern, "[0-9]{2}\\.[0-9]{3}");
	level5.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/skd2008/subclass"));

	// Attach the level list to the classification
	levelList = model.createList(new RDFNode[] {level1, level2, level3, level4, level5});
	scheme.addProperty(XKOS.levels, levelList);
}
 
开发者ID:FranckCo,项目名称:Stamina,代码行数:57,代码来源:SKDModelMaker.java


示例16: createClassificationAndLevels

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
/**
 * Creates in the model the resources representing the classification and its levels.
 */
	public void createClassificationAndLevels() {

	// Create the resource representing the classification (skos:ConceptScheme)
	scheme = model.createResource(BASE_URI + "naics", SKOS.ConceptScheme);
	scheme.addProperty(SKOS.prefLabel, model.createLiteral("North American Industry Classification System (NAICS) 2012", "en"));
	scheme.addProperty(SKOS.notation, "NAICS 2012");
	scheme.addProperty(SKOS.definition, model.createLiteral("The North American Industry Classification System (NAICS) is the standard used by Federal statistical agencies in classifying business establishments for the purpose of collecting, analyzing, and publishing statistical data related to the U.S. business economy.", "en"));
	scheme.addProperty(DC.publisher, model.createResource("http://www.census.gov"));
	scheme.addProperty(DC.date, model.createTypedLiteral("2012-01-01", "http://www.w3.org/2001/XMLSchema#date"));
	scheme.addProperty(FOAF.homepage, model.createResource("http://www.census.gov/eos/www/naics/"));
	scheme.addProperty(XKOS.covers, model.createResource("http://eurovoc.europa.eu/5992"));
	scheme.addProperty(XKOS.numberOfLevels, model.createTypedLiteral(5));

	// Create the resources representing the levels (xkos:ClassificationLevel)
	Resource level1 = model.createResource(BASE_URI + "/sectors", XKOS.ClassificationLevel);
	level1.addProperty(SKOS.prefLabel, model.createLiteral("NAICS 2012 - level 1 - Sectors", "en"));
	level1.addProperty(XKOS.depth, model.createTypedLiteral(1));
	level1.addProperty(XKOS.notationPattern, "[1-9]{2}");
	level1.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/naics2012/sector"));

	Resource level2 = model.createResource(BASE_URI + "/subsectors", XKOS.ClassificationLevel);
	level2.addProperty(SKOS.prefLabel, model.createLiteral("NAICS 2012 - level 2 - Subsectors", "en"));
	level2.addProperty(XKOS.depth, model.createTypedLiteral(2));
	level2.addProperty(XKOS.notationPattern, "[1-9]{3}");
	level2.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/naics2012/subsector"));

	Resource level3 = model.createResource(BASE_URI + "/groups", XKOS.ClassificationLevel);
	level3.addProperty(SKOS.prefLabel, model.createLiteral("NAICS 2012 - level 3 - Groups", "en"));
	level3.addProperty(XKOS.depth, model.createTypedLiteral(3));
	level3.addProperty(XKOS.notationPattern, "[1-9]{4}");
	level3.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/naics2012/group"));

	Resource level4 = model.createResource(BASE_URI + "/naics-industries", XKOS.ClassificationLevel);
	level4.addProperty(SKOS.prefLabel, model.createLiteral("NAICS 2012 - level 4 - NAICS Industries", "en"));
	level4.addProperty(XKOS.depth, model.createTypedLiteral(4));
	level4.addProperty(XKOS.notationPattern, "[1-9]{5}");
	level4.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/naics2012/naics-industry"));

	Resource level5 = model.createResource(BASE_URI + "/national-industries", XKOS.ClassificationLevel);
	level5.addProperty(SKOS.prefLabel, model.createLiteral("NAICS 2012 - level 5 - National Industries", "en"));
	level5.addProperty(XKOS.depth, model.createTypedLiteral(5));
	level5.addProperty(XKOS.notationPattern, "[1-9]{5}[0-9]");
	level5.addProperty(XKOS.organizedBy, model.createResource("http://stamina-project.org/concepts/naics2012/national-industry"));

	// Attach the level list to the classification
	levelList = model.createList(new RDFNode[] {level1, level2, level3, level4, level5});
	scheme.addProperty(XKOS.levels, levelList);
}
 
开发者ID:FranckCo,项目名称:Stamina,代码行数:52,代码来源:NAICSModelMaker.java


示例17: getFirstName

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public String getFirstName(){
	Statement stmt = resource.getProperty(FOAF.firstName);
	return ((Literal)stmt.getObject()).getLexicalForm();
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:5,代码来源:Person.java


示例18: getName

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public String getName(){
	Statement stmt = resource.getProperty(FOAF.name);
	return ((Literal)stmt.getObject()).getLexicalForm();
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:5,代码来源:Person.java


示例19: asConfResource

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
public Resource asConfResource(Model model){
	String localName = resource.getLocalName();
	
	Resource person = model.createResource(ConferenceOntology.RESOURCE_NS + "person/" + localName);
	
	Model modelIn = resource.getModel();
	
	String sparql = 
			"CONSTRUCT {"
			+ "<" + person.getURI() + "> a <" + ConferenceOntology.Person.getURI() + "> . "
			+ "<" + person.getURI() + "> <" + RDFS.label + "> ?label . "
			+ "<" + person.getURI() + "> <" + ConferenceOntology.name + "> ?name . "
			+ "<" + person.getURI() + "> <" + ConferenceOntology.givenName + "> ?firstName . "
			+ "<" + person.getURI() + "> <" + ConferenceOntology.familyName + "> ?lastName . "
			+ "<" + person.getURI() + "> <" + FOAF.mbox_sha1sum + "> ?mbox_sha1sum . "
			+ "<" + person.getURI() + "> <" + OWL2.sameAs + "> <" + resource.getURI() + "> "
			+ "}"
			+ "WHERE{ "
			+ "<" + resource.getURI() + "> <" + RDFS.label + "> ?label . "
			+ "<" + resource.getURI() + "> <" + FOAF.name + "> ?name . "
			+ "OPTIONAL {<" + resource.getURI() + "> <" + FOAF.firstName + "> ?firstName}"
			+ "OPTIONAL {<" + resource.getURI() + "> <http://xmlns.com/foaf/0.1/lastName> ?lastName}"
			+ "OPTIONAL {<" + resource.getURI() + "> <" + FOAF.mbox_sha1sum + "> ?mbox_sha1sum}"
			+ "}";
	
	model.add(QueryExecutor.execConstruct(modelIn, sparql));
	
	
	System.out.println("create roles");
	Set<Resource> timeIndexedSituations = createRoles(model);
	for(Resource roleDuringEvent : timeIndexedSituations){
		System.out.println("     " + roleDuringEvent);
		
		
		person.addProperty(ConferenceOntology.holdsRole, roleDuringEvent);
		roleDuringEvent.addProperty(ConferenceOntology.isHeldBy, person);
	}
	
	timeIndexedSituations = createAffiliations(model);
	for(Resource affiliationDuringEvent : timeIndexedSituations){
		person.addProperty(ConferenceOntology.hasAffiliation, affiliationDuringEvent);
		affiliationDuringEvent.addProperty(ConferenceOntology.isAffiliationOf, person);
	}
	
	return person;
	
}
 
开发者ID:AnLiGentile,项目名称:cLODg,代码行数:48,代码来源:Person.java


示例20: addVOID

import org.apache.jena.sparql.vocabulary.FOAF; //导入依赖的package包/类
private static Model addVOID(Resource completeGraph, String datasetName){
	
	Model model = ModelFactory.createDefaultModel(); 
	
	System.out.println("Complete graph " + completeGraph);
	System.out.println("Dataset name " + datasetName);
	
	Resource datasetType = model.createResource("http://rdfs.org/ns/void#Dataset");
	Resource dataset = model.createResource(ConferenceOntology.RESOURCE_NS + "dataset/" + datasetName, datasetType);
	dataset.addLiteral(DCTerms.title, "Dataset about " + datasetName + ".");
	dataset.addLiteral(DCTerms.created, new Date(System.currentTimeMillis()).toString());
	
	Resource andrea = model.createResource(ConferenceOntology.RESOURCE_NS + "person/andrea-giovanni-nuzzolese", FOAF.Person);
	andrea.addProperty(FOAF.name, "Andrea Giovanni Nuzzolese");
	andrea.addProperty(FOAF.givenname, "Andrea Giovanni");
	andrea.addProperty(ModelFactory.createDefaultModel().createProperty(FOAF.NS + "familyName"), "Nuzzolese");
	
	Resource annalisa = model.createResource(ConferenceOntology.RESOURCE_NS + "person/anna-lisa-gentile", FOAF.Person);
	annalisa.addProperty(FOAF.name, "Anna Lisa Gentile");
	annalisa.addProperty(FOAF.givenname, "Anna Lisa");
	annalisa.addProperty(ModelFactory.createDefaultModel().createProperty(FOAF.NS + "familyName"), "Gentile");
	
	Resource valentina = model.createResource(ConferenceOntology.RESOURCE_NS + "person/valentina-presutti", FOAF.Person);
	valentina.addProperty(FOAF.name, "Valentina Presutti");
	valentina.addProperty(FOAF.givenname, "Valentina");
	valentina.addProperty(ModelFactory.createDefaultModel().createProperty(FOAF.NS + "familyName"), "Presutti");
	
	Resource aldo = model.createResource(ConferenceOntology.RESOURCE_NS + "person/aldo-gangemi", FOAF.Person);
	aldo.addProperty(FOAF.name, "Aldo Gangemi");
	aldo.addProperty(FOAF.givenname, "Aldo");
	aldo.addProperty(ModelFactory.createDefaultModel().createProperty(FOAF.NS + "familyName"), "Gangemi");
	
	dataset.addProperty(DCTerms.creator, andrea);
	dataset.addProperty(DCTerms.creator, annalisa);
	dataset.addProperty(DCTerms.creator, valentina);
	dataset.addProperty(DCTerms.creator, aldo);
	
	
	dataset.addProperty(model.createProperty("http://www.w3.org/ns/prov#hadPrimarySource"), completeGraph);
	
	return model;
}
 
                      

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AudioSpectrumListener类代码示例发布时间:2022-05-22
下一篇:
Java Version类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap