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


Java FOAF类代码示例

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


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


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