Refine search
private String createContainer(String url, String slug, SolidUtilities utilities) throws Exception { Model containerModel = ModelFactory.createDefaultModel(); Resource containerResource = containerModel.createResource(""); containerResource.addProperty(DCTerms.title, slug); return utilities.postContent(url, slug, BASIC_CONTAINER_TYPE, containerModel); }
protected Resource createResult(Model results, Resource type) { Resource result = results.createResource(type); result.addProperty(DASH.testCase, resource); result.addProperty(DASH.testGraph, graph); return result; }
private String createIndex(String url, String slug, SolidUtilities utilities) throws Exception { Model model = ModelFactory.createDefaultModel(); Resource containerResource = model.createResource("#this"); containerResource.addProperty(RDF.type, model.getResource(VCARD4.NS + "AddressBook")); containerResource.addProperty( model.createProperty(VCARD4.NS + "nameEmailIndex"), model.createResource("people.ttl")); containerResource.addProperty( model.createProperty(VCARD4.NS + "groupIndex"), model.createResource("groups.ttl")); containerResource.addProperty(DC_11.title, slug); return utilities.postContent( url, "index", BASIC_RESOURCE_TYPE, model); }
protected Resource createResult(Model results, Resource type) { Resource result = results.createResource(type); result.addProperty(DASH.testCase, resource); result.addProperty(DASH.testGraph, graph); return result; }
private String createPeopleFile( String baseUrl, String containerUrl, Map<String, VCard> importedPeople, SolidUtilities utilities) throws Exception { Model peopleModel = ModelFactory.createDefaultModel(); Resource indexResource = peopleModel.createResource("index.ttl#this"); for (String insertedId : importedPeople.keySet()) { VCard insertedPerson = importedPeople.get(insertedId); String relativePath = insertedId.replace(containerUrl, ""); Resource personResource = peopleModel.createResource(relativePath + "#this"); if (insertedPerson.getFormattedName() != null) { personResource.addProperty(VCARD4.fn, insertedPerson.getFormattedName().getValue()); } personResource.addProperty( peopleModel.createProperty(VCARD4.NS, "inAddressBook"), indexResource); } return utilities.postContent( baseUrl + containerUrl, "people", BASIC_RESOURCE_TYPE, peopleModel); }
/** * Register a Reasoner - simple case with no RDF description. * @param factory an factory that can be used to create instances of the reasoner * @param reasonerUri the URI used to label the reasoner, expressed as a * simple string */ public void register(String reasonerUri, ReasonerFactory factory) { reasonerFactories.put(reasonerUri, factory); allDescriptions.createResource(reasonerUri) .addProperty(RDF.type, ReasonerVocabulary.ReasonerClass); }
@VisibleForTesting final static Model getPersonModel(VCard vcard) { Model personModel = ModelFactory.createDefaultModel(); Resource r = personModel.createResource("#this"); r.addProperty(RDF.type, VCARD4.Individual); r.addProperty(VCARD4.fn, vcard.getFormattedName().getValue()); Resource strucName = personModel.createResource(); if (!Strings.isNullOrEmpty(structuredName.getFamily())) { strucName.addProperty(VCARD4.family_name, structuredName.getFamily()); strucName.addProperty(VCARD4.given_name, structuredName.getGiven()); .forEach(prefix -> strucName.addProperty(VCARD4.hasHonorificPrefix, prefix)); .forEach(suffix -> strucName.addProperty(VCARD4.hasHonorificSuffix, suffix)); .forEach(additional -> strucName.addProperty(VCARD4.hasAdditionalName, additional)); r.addProperty(VCARD4.hasName, strucName); String mailTo = "mailto:" + email.getValue(); if (email.getTypes().isEmpty()) { r.addProperty(VCARD4.hasEmail, mailTo); } else { Resource emailResource = personModel.createResource(); emailResource.addProperty(VCARD4.value, mailTo); for (EmailType type : email.getTypes()) { for (Resource emailTypeResource :
/** * Register a Reasoner - simple case with no RDF description. * @param factory an factory that can be used to create instances of the reasoner * @param reasonerUri the URI used to label the reasoner, expressed as a * simple string */ public void register(String reasonerUri, ReasonerFactory factory) { reasonerFactories.put(reasonerUri, factory); allDescriptions.createResource(reasonerUri) .addProperty(RDF.type, ReasonerVocabulary.ReasonerClass); }
/** * Return a description of the capabilities of this reasoner encoded in * RDF. This method is normally called by the ReasonerRegistry which caches * the resulting information so dynamically creating here is not really an overhead. */ @Override public Model getCapabilities() { if (capabilities == null) { capabilities = ModelFactory.createDefaultModel(); Resource base = capabilities.createResource(getURI()); base.addProperty(ReasonerVocabulary.nameP, "Transitive Reasoner") .addProperty(ReasonerVocabulary.descriptionP, "Provides reflexive-transitive closure of subClassOf and subPropertyOf") .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf) .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubPropertyOf) .addProperty(ReasonerVocabulary.versionP, "0.1"); } return capabilities; }
private void addNeedList(Model model, Resource res) { res.addProperty(WON.HAS_NEED_LIST, model.createResource(this.needResourceURIPrefix)); }
/** * Return a description of the capabilities of this reasoner encoded in * RDF. This method is normally called by the ReasonerRegistry which caches * the resulting information so dynamically creating here is not really an overhead. */ @Override public Model getCapabilities() { if (capabilities == null) { capabilities = ModelFactory.createDefaultModel(); Resource base = capabilities.createResource(getURI()); base.addProperty(ReasonerVocabulary.nameP, "RDFS FB-TGC Rule Reasoner") .addProperty(ReasonerVocabulary.descriptionP, "Complete RDFS implementation supporting metalevel statements.\n" + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.member) .addProperty(ReasonerVocabulary.supportsP, RDFS.range) .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) .addProperty(ReasonerVocabulary.versionP, "0.1"); } return capabilities; }
public Resource asRDF(Model model, boolean result) { Resource results = model.createResource() ; results.addProperty(RDF.type, ResultSetGraphVocab.ResultSet) ; Literal lit = model.createTypedLiteral(result) ; results.addProperty(ResultSetGraphVocab.p_boolean, lit) ; return results ; }
/** * Return a description of the capabilities of this reasoner encoded in * RDF. This method is normally called by the ReasonerRegistry which caches * the resulting information so dynamically creating here is not really an overhead. */ @Override public Model getCapabilities() { if (capabilities == null) { capabilities = ModelFactory.createDefaultModel(); Resource base = capabilities.createResource(getURI()); base.addProperty(ReasonerVocabulary.nameP, "Transitive Reasoner") .addProperty(ReasonerVocabulary.descriptionP, "Provides reflexive-transitive closure of subClassOf and subPropertyOf") .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf) .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubPropertyOf) .addProperty(ReasonerVocabulary.versionP, "0.1"); } return capabilities; }
/** * Creates an RDF model containing a feedback message referring to the specified resource * that is either positive or negative. * @return */ public static Model binaryFeedbackMessage(URI forResource, boolean isFeedbackPositive) { Model messageModel = createModelWithBaseResource(); Resource baseRes = RdfUtils.getBaseResource(messageModel); Resource feedbackNode = messageModel.createResource(); baseRes.addProperty(WON.HAS_FEEDBACK, feedbackNode); feedbackNode.addProperty(WON.HAS_BINARY_RATING, isFeedbackPositive ? WON.GOOD : WON.BAD); feedbackNode.addProperty(WON.FOR_RESOURCE, messageModel.createResource(forResource.toString())); return messageModel; }
@Override public Model getCapabilities() { if (!_reasonerCapabilities.isPresent()) { _reasonerCapabilities = Optional.of(ModelFactory.createDefaultModel()); final Resource base = _reasonerCapabilities.get().createResource(URI); base.addProperty(ReasonerVocabulary.nameP, "Openllet Reasoner")// .addProperty(ReasonerVocabulary.descriptionP, "Reasoner that is backed by the OWL DL reasoner Openllet.")// .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf)// .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf)// .addProperty(ReasonerVocabulary.supportsP, RDFS.member)// .addProperty(ReasonerVocabulary.supportsP, RDFS.range)// .addProperty(ReasonerVocabulary.supportsP, RDFS.domain)// .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP)// .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf)// .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubPropertyOf)// .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directRDFType);// } return _reasonerCapabilities.get(); }
private void processRequest( Resource earlResult, Model earl, Element reqElement ) { Resource httpReq = createEarlRequest( earl, reqElement ); if ( httpReq == null ) return; String response = parseNodeAsString( reqElement, "response" ); if ( response != null ) { Resource httpRsp = earl.createResource( HTTP.Response ); Resource rspContent = earl.createResource( CONTENT.ContentAsXML ); rspContent.addProperty( CONTENT.rest, response ); httpRsp.addProperty( HTTP.body, rspContent ); httpReq.addProperty( HTTP.resp, httpRsp ); } earlResult.addProperty( CITE.message, httpReq ); }
/** * Return a description of the capabilities of this reasoner encoded in * RDF. This method is normally called by the ReasonerRegistry which caches * the resulting information so dynamically creating here is not really an overhead. */ @Override public Model getCapabilities() { if (capabilities == null) { capabilities = ModelFactory.createDefaultModel(); Resource base = capabilities.createResource(getURI()); base.addProperty(ReasonerVocabulary.nameP, "RDFS FB Rule Reasoner") .addProperty(ReasonerVocabulary.descriptionP, "Complete RDFS implementation supporting metalevel statements.\n" + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.member) .addProperty(ReasonerVocabulary.supportsP, RDFS.range) .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) .addProperty(ReasonerVocabulary.versionP, "0.1"); } return capabilities; }
private void addTestRequirements( Model earl, TestInfo testInfo ) { Resource testReq = earl.createResource( testInfo.testName.replaceAll( "\\s", "-" ), EARL.TestRequirement ); testReq.addProperty( DCTerms.title, testInfo.testName ); testReq.addProperty( CITE.isBasic, Boolean.toString( testInfo.isBasic ) ); this.reqs.add( testReq ); }
/** * Return a description of the capabilities of this reasoner encoded in * RDF. This method is normally called by the ReasonerRegistry which caches * the resulting information so dynamically creating here is not really an overhead. */ @Override public Model getCapabilities() { if (capabilities == null) { capabilities = ModelFactory.createDefaultModel(); Resource base = capabilities.createResource(getURI()); base.addProperty(ReasonerVocabulary.nameP, "RDFS FB-TGC Rule Reasoner") .addProperty(ReasonerVocabulary.descriptionP, "Complete RDFS implementation supporting metalevel statements.\n" + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.") .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf) .addProperty(ReasonerVocabulary.supportsP, RDFS.member) .addProperty(ReasonerVocabulary.supportsP, RDFS.range) .addProperty(ReasonerVocabulary.supportsP, RDFS.domain) .addProperty(ReasonerVocabulary.versionP, "0.1"); } return capabilities; }
private void addTestRequirements( Model earl, TestInfo testInfo ) { Resource testReq = earl.createResource( testInfo.testName.replaceAll( "\\s", "-" ), EARL.TestRequirement ); testReq.addProperty( DCTerms.title, testInfo.testName ); testReq.addProperty( CITE.isBasic, Boolean.toString( testInfo.isBasic ) ); this.reqs.add( testReq ); }