Java Code Examples for com.hp.hpl.jena.ontology.OntClass#hasSuperClass()

The following examples show how to use com.hp.hpl.jena.ontology.OntClass#hasSuperClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConceptImpl.java    From semanticMDR with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setParentConcept(ObjectClass parent) {
	if (parent != null) {
		this.addProperty(RDFS.subClassOf, parent.asMDRResource());
	} else {
		ExtendedIterator<OntClass> l = this.listSuperClasses();
		OntClass found = null;
		while (l.hasNext()) {
			OntClass ontClass = l.next();
			if (ontClass.hasSuperClass(mdrDatabase.getVocabulary().Concept)) {
				found = ontClass;
			}
		}
		if (found != null) {
			this.removeProperty(RDFS.subClassOf, found);
		}
	}
}
 
Example 2
Source File: Repository.java    From semanticMDR with GNU General Public License v3.0 6 votes vote down vote up
public ValueDomain getValueDomain(String valueDomainID) {
	Resource resource = mdrDatabase.getQueryFactory().getAdministeredItem(
			valueDomainID);
	OntClass res = mdrDatabase.getOntModel().getOntClass(resource.getURI());
	if (res == null) {
		return null;
	}
	ValueDomain vd = null;
	if (res.hasSuperClass(
			mdrDatabase.getVocabulary().EnumeratedValueDomain, false)) {
		vd = new EnumeratedValueDomainImpl(res, mdrDatabase);

	} else {
		vd = new NonEnumeratedValueDomainImpl(res, mdrDatabase);
	}
	return vd;
}
 
Example 3
Source File: ValueDomainImpl.java    From semanticMDR with GNU General Public License v3.0 6 votes vote down vote up
@Override
public ConceptualDomainResource getRepresentingConceptualDomainRepresentation() {
	RDFNode representingConceptualDomainRepresentation = getPropertyValue(mdrDatabase
			.getVocabulary().representingConceptualDomainRepresentation);
	OntClass ontClass = representingConceptualDomainRepresentation.as(
			OntResource.class).asClass();

	ConceptualDomainResource conceptualDomainIND = null;
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
		conceptualDomainIND = new EnumeratedConceptualDomainImpl(
				representingConceptualDomainRepresentation.asResource(),
				mdrDatabase);
	}
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().NonEnumeratedConceptualDomain)) {
		conceptualDomainIND = new NonEnumeratedConceptualDomainImpl(
				representingConceptualDomainRepresentation.asResource(),
				mdrDatabase);
	}
	if (conceptualDomainIND == null) {
		throw new IllegalStateException(
				"Property value should have a valid OntClass.");
	}
	return conceptualDomainIND;
}
 
Example 4
Source File: DataElementConceptImpl.java    From semanticMDR with GNU General Public License v3.0 6 votes vote down vote up
@Override
public ObjectClassResource getDataElementConceptObjectClass() {
	RDFNode dataElementConceptObjectClass = getPropertyValue(mdrDatabase
			.getVocabulary().dataElementConceptObjectClass);
	if (dataElementConceptObjectClass == null) {
		logger.debug("DataElemenetConcept does not have an ObjectClass");
		return null;
	}
	OntClass ontClass = dataElementConceptObjectClass.as(OntResource.class)
			.asClass();
	ObjectClassResource objectClassIND = null;
	if (ontClass.hasSuperClass(mdrDatabase.getVocabulary().Concept)) {
		objectClassIND = new ConceptImpl(
				dataElementConceptObjectClass.asResource(), mdrDatabase);
	}
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().ConceptRelationship)) {
		objectClassIND = new ConceptRelationshipImpl(
				dataElementConceptObjectClass.asResource(), mdrDatabase);
	}
	if (objectClassIND == null) {
		throw new IllegalStateException(
				"Property value should have a valid OntClass.");
	}
	return objectClassIND;
}
 
Example 5
Source File: DataElementConceptImpl.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ConceptualDomainResource getHavingDataElementConceptConceptualDomainRelationship() {
	RDFNode havingDataElementConceptConceptualDomainRelationship = getPropertyValue(mdrDatabase
			.getVocabulary().havingDataElementConceptConceptualDomainRelationship);
	OntClass ontClass = havingDataElementConceptConceptualDomainRelationship
			.as(OntResource.class).asClass();
	ConceptualDomainResource conceptualDomainIND = null;
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
		conceptualDomainIND = new EnumeratedConceptualDomainImpl(
				havingDataElementConceptConceptualDomainRelationship
						.asResource(),
				mdrDatabase);
	}
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().NonEnumeratedConceptualDomain)) {
		conceptualDomainIND = new NonEnumeratedConceptualDomainImpl(
				havingDataElementConceptConceptualDomainRelationship
						.asResource(),
				mdrDatabase);
	}
	if (conceptualDomainIND == null) {
		throw new IllegalStateException(
				"Property value should have a OntClass");
	}
	return conceptualDomainIND;
}
 
Example 6
Source File: ConceptImpl.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ObjectClass getParentConcept() {
	NodeIterator l = this.listPropertyValues(RDFS.subClassOf);

	while (l.hasNext()) {
		RDFNode res = l.nextNode();
		if (res.canAs(OntClass.class)) {
			OntClass ontClass = res.as(OntClass.class);
			if (ontClass.hasSuperClass(mdrDatabase.getVocabulary().Concept)) {
				return new ConceptImpl(res.asResource(), mdrDatabase);
			}
		}
	}
	return null;
}
 
Example 7
Source File: ConceptualDomainImpl.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ValueDomain getValueDomain(String valueDomainID) {
	Resource vdResource = mdrDatabase.getQueryFactory()
			.getAdministeredItem(valueDomainID);
	OntClass vd = mdrDatabase.getOntModel()
			.getOntClass(vdResource.getURI());
	if (vd.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain,
			false)) {
		return new EnumeratedValueDomainImpl(vd, mdrDatabase);
	} else {
		return new NonEnumeratedValueDomainImpl(vd, mdrDatabase);
	}
}
 
Example 8
Source File: Repository.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param cid
 *            Unique ID of the {@link ConceptualDomain} in the
 *            {@link MDRDatabase}
 * @return The {@link ConceptualDomain}
 */
public ConceptualDomain getConceptualDomain(String uniqueID) {
	Resource cdResource = mdrDatabase.getQueryFactory()
			.getAdministeredItem(uniqueID);
	OntClass cd = mdrDatabase.getOntModel()
			.getOntClass(cdResource.getURI());

	if (cd.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
		return new EnumeratedConceptualDomainImpl(cd, mdrDatabase);
	} else {
		return new NonEnumeratedConceptualDomainImpl(cd, mdrDatabase);
	}
}
 
Example 9
Source File: DataElementImpl.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ValueDomainResource getRepresentedByDataElementRepresentation() {
	RDFNode representedByDataElementRepresentation = getPropertyValue(mdrDatabase
			.getVocabulary().representedByDataElementRepresentation);
	OntClass ontClass = representedByDataElementRepresentation.as(
			OntResource.class).asClass();

	ValueDomainResource valueDomainIND = null;
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
		valueDomainIND = new EnumeratedValueDomainImpl(
				representedByDataElementRepresentation.asResource(),
				mdrDatabase);
		logger.info("Representer ValueDomain is an EnumeratedValueDomain");
	}
	if (ontClass
			.hasSuperClass(mdrDatabase.getVocabulary().NonEnumeratedValueDomain)) {
		valueDomainIND = new NonEnumeratedValueDomainImpl(
				representedByDataElementRepresentation.asResource(),
				mdrDatabase);
	}
	if (valueDomainIND == null) {
		throw new IllegalStateException(
				"Property value should have a valid OntClass.");
	}
	return valueDomainIND;
}
 
Example 10
Source File: ResourceQueryFactory.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
public List<? super ValueDomainResource> getValueDomainsOfConceptualDomain(
		String cdURI) {
	List<ValueDomainResource> vdList = new ArrayList<ValueDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS).append("SELECT ?vd FROM <")
			.append(MDRDatabase.BASE_URI).append("> WHERE {")
			.append("?vdClass rdfs:subClassOf mdr:ValueDomain .")
			.append("?vd rdfs:subClassOf ?vdClass . ")
			.append("?vd mdr:representingConceptualDomainRepresentation <")
			.append(cdURI).append("> .").append("}");
	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = mdrDatabase.getOntModel().getOntClass(
					qs.getResource("vd").getURI());
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
				vdList.add(new EnumeratedValueDomainImpl(res, mdrDatabase));
			} else {
				vdList.add(new NonEnumeratedValueDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}

	return vdList;
}
 
Example 11
Source File: ResourceQueryFactory.java    From semanticMDR with GNU General Public License v3.0 5 votes vote down vote up
public List<? super ValueMeaningResource> listValueMeningsOfCD(
		String cdURI, int limit, int offset) {
	List<ValueMeaningResource> vmList = new ArrayList<ValueMeaningResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS).append("SELECT DISTINCT ?vm FROM <")
			.append(MDRDatabase.BASE_URI).append("> WHERE {")
			.append("?vm rdfs:subClassOf mdr:ValueMeaning .")
			.append("?vm mdr:valueMeaningIdentifier ?id . ")
			.append("?vm mdr:containedInValueMeaningSet <").append(cdURI)
			.append("> .").append("} ORDER BY ?id LIMIT ").append(limit)
			.append(" OFFSET ").append(offset);
	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = mdrDatabase.getOntModel().getOntClass(
					qs.getResource("vm").getURI());
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
				vmList.add(new ValueMeaningImpl(res, mdrDatabase));
			} else {
				vmList.add(new ValueMeaningImpl(res, mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}

	return vmList;
}
 
Example 12
Source File: ResourceQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 
 * @param contextURI
 * @param limit
 * @param offset
 * @return
 */
public List<? super ConceptualDomainResource> getConceptualDomainsOfContext(
		String contextURI, Integer limit, Integer offset) {
	List<ConceptualDomainResource> cdList = new ArrayList<ConceptualDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS).append("SELECT ?cd FROM <")
			.append(MDRDatabase.BASE_URI).append("> WHERE {")
			.append("?cdClass rdfs:subClassOf mdr:ConceptualDomain .")
			.append("?cd rdfs:subClassOf ?cdClass .")
			.append("?cd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextContext <")
			.append(contextURI).append("> . }");
	if (limit != null && offset != null) {
		queryString.append(" LIMIT ").append(limit).append(" OFFSET ")
				.append(offset);
	}
	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = mdrDatabase.getOntModel().getOntClass(
					qs.getResource("cd").getURI());
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
				cdList.add(new EnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			} else {
				cdList.add(new NonEnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}

	return cdList;
}
 
Example 13
Source File: ResourceQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
public List<? super ValueDomainResource> getValueDomainsOfContext(
		String contextURI, Integer limit, Integer offset) {
	List<ValueDomainResource> valueDomainResourceList = new ArrayList<ValueDomainResource>();

	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS).append("SELECT ?vd FROM <")
			.append(MDRDatabase.BASE_URI).append("> WHERE {")
			.append("?vdClass rdfs:subClassOf mdr:ValueDomain .")
			.append("?vd rdfs:subClassOf mdr:vdClass . ")
			.append("?vd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextContext <")
			.append(contextURI).append("> .").append("}");
	if (limit != null && offset != null) {
		queryString.append(" ORDER BY ?de ").append(" LIMIT ")
				.append(limit).append(" OFFSET ").append(offset);
	}
	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());

	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = mdrDatabase.getOntModel().getOntClass(
					qs.getResource("cd").getURI());
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
				valueDomainResourceList.add(new EnumeratedValueDomainImpl(
						res, mdrDatabase));
			} else {
				valueDomainResourceList
						.add(new NonEnumeratedValueDomainImpl(res,
								mdrDatabase));
			}
		}
	} finally {
		qexec.close();
	}
	return valueDomainResourceList;
}
 
Example 14
Source File: TDBQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
@Override
public List<? super ConceptualDomainResource> searchConceptualDomain(
		String keyword, String contextURI, TextSearchType searchType) {
	List<ConceptualDomainResource> cdList = new ArrayList<ConceptualDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_PF)
			.append(PREFIX_RDFS)
			.append("SELECT ?cd FROM <")
			.append(MDRDatabase.BASE_URI)
			.append("> WHERE {")
			.append("?cdClass rdfs:subClassOf mdr:ConceptualDomain .")
			.append("?cd rdfs:subClassOf ?cdClass .")
			.append("?cd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextTerminologicalEntry ?te .")
			.append("?te mdr:containingTerminologicalEntryLanguage ?ls .")
			.append("?ls mdr:containingNameEntry ?designation .")
			.append("?designation mdr:name ?name .");
	if (!Util.isNull(contextURI)) {
		queryString.append("?aic mdr:administeredItemContextContext <")
				.append(contextURI).append("> .");
	}
	if (keyword.matches("\\s*")) {
		return cdList;
	}
	if (searchType == null || searchType.equals(TextSearchType.Exact)) {
		queryString.append(exactMatchKeyword(keyword));
	}

	else if (searchType.equals(TextSearchType.WildCard)) {
		queryString.append(atLeastOneKeyword(keyword));
	}

	else {
		queryString.append(allWordsKeyword(keyword));
	}
	queryString.append(" .}");

	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = qs.getResource("cd").as(OntClass.class);
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
				cdList.add(new EnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			} else {
				cdList.add(new NonEnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}
	return cdList;
}
 
Example 15
Source File: TDBQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
@Override
public List<? super ValueDomainResource> searchValueDomain(String keyword,
		String contextURI, TextSearchType searchType) {
	List<ValueDomainResource> vdList = new ArrayList<ValueDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_PF)
			.append(PREFIX_RDFS)
			.append("SELECT ?cd FROM <")
			.append(MDRDatabase.BASE_URI)
			.append("> WHERE {")
			.append("?cdClass rdfs:subClassOf mdr:ValueDomain .")
			.append("?cd rdfs:subClassOf ?cdClass .")
			.append("?cd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextTerminologicalEntry ?te .")
			.append("?te mdr:containingTerminologicalEntryLanguage ?ls .")
			.append("?ls mdr:containingNameEntry ?designation .")
			.append("?designation mdr:name ?name .");
	if (!Util.isNull(contextURI)) {
		queryString.append("?aic mdr:administeredItemContextContext <")
				.append(contextURI).append("> .");
	}
	if (keyword.matches("\\s*")) {
		return vdList;
	}
	if (searchType == null || searchType.equals(TextSearchType.Exact)) {
		queryString.append(exactMatchKeyword(keyword));
	}

	else if (searchType.equals(TextSearchType.WildCard)) {
		queryString.append(atLeastOneKeyword(keyword));
	}

	else {
		queryString.append(allWordsKeyword(keyword));
	}
	queryString.append(" .}");

	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			OntClass res = qs.getResource("cd").as(OntClass.class);
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
				vdList.add(new EnumeratedValueDomainImpl(res, mdrDatabase));
			} else {
				vdList.add(new NonEnumeratedValueDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}
	return vdList;
}
 
Example 16
Source File: VirtuosoQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
@Override
public List<? super ConceptualDomainResource> searchConceptualDomain(
		String keyword, String contextURI, TextSearchType searchType) {
	List<ConceptualDomainResource> cdList = new ArrayList<ConceptualDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS)
			.append("SELECT ?cd FROM <")
			.append(MDRDatabase.BASE_URI)
			.append("> WHERE {")
			.append("?cdClass rdfs:subClassOf mdr:ConceptualDomain .")
			.append("?cd rdfs:subClassOf ?cdClass .")
			.append("?cd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextTerminologicalEntry ?te .")
			.append("?te mdr:containingTerminologicalEntryLanguage ?ls .")
			.append("?ls mdr:containingNameEntry ?designation .")
			.append("?designation mdr:name ?name .");
	if (!Util.isNull(contextURI)) {
		queryString.append("?aic mdr:administeredItemContextContext <")
				.append(contextURI).append("> .");
	}
	if (keyword.matches("\\s*")) {
		return cdList;
	}
	if (searchType == null || searchType.equals(TextSearchType.Exact)) {
		queryString.append(exactMatchKeyword(keyword));
	}

	else if (searchType.equals(TextSearchType.WildCard)) {
		queryString.append(atLeastOneKeyword(keyword));
	}

	else {
		queryString.append(allWordsKeyword(keyword));
	}
	queryString.append(" .}");

	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			Resource tempRes = this.mdrDatabase.getOntModel().getResource(
					qs.getResource("cd").getURI());
			OntClass res = tempRes.as(OntClass.class);
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedConceptualDomain)) {
				cdList.add(new EnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			} else {
				cdList.add(new NonEnumeratedConceptualDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}
	return cdList;
}
 
Example 17
Source File: VirtuosoQueryFactory.java    From semanticMDR with GNU General Public License v3.0 4 votes vote down vote up
@Override
public List<? super ValueDomainResource> searchValueDomain(String keyword,
		String uri, TextSearchType searchType) {
	List<ValueDomainResource> vdList = new ArrayList<ValueDomainResource>();
	StringBuilder queryString = new StringBuilder(PREFIX_MDR)
			.append(PREFIX_RDFS)
			.append("SELECT ?cd FROM <")
			.append(MDRDatabase.BASE_URI)
			.append("> WHERE {")
			.append("?cdClass rdfs:subClassOf mdr:ValueDomain .")
			.append("?cd rdfs:subClassOf ?cdClass .")
			.append("?cd mdr:having ?aic .")
			.append("?aic mdr:administeredItemContextTerminologicalEntry ?te .")
			.append("?te mdr:containingTerminologicalEntryLanguage ?ls .")
			.append("?ls mdr:containingNameEntry ?designation .")
			.append("?designation mdr:name ?name .");
	if (!Util.isNull(uri)) {
		queryString.append("?aic mdr:administeredItemContextContext <")
				.append(uri).append("> .");
	}
	if (keyword.matches("\\s*")) {
		return vdList;
	}
	if (searchType == null || searchType.equals(TextSearchType.Exact)) {
		queryString.append(exactMatchKeyword(keyword));
	}

	else if (searchType.equals(TextSearchType.WildCard)) {
		queryString.append(atLeastOneKeyword(keyword));
	}

	else {
		queryString.append(allWordsKeyword(keyword));
	}
	queryString.append(" .}");

	QueryExecution qexec = this.createQueryExecution(
			queryString.toString(), this.mdrDatabase.getOntModel());
	try {
		ResultSet rs = qexec.execSelect();
		while (rs.hasNext()) {
			QuerySolution qs = rs.next();
			// here conceptualDomain is checked whether its enumerated or
			// not, proper instantiation is done
			Resource tempRes = this.mdrDatabase.getOntModel().getResource(
					qs.getResource("cd").getURI());
			OntClass res = tempRes.as(OntClass.class);
			if (res.hasSuperClass(mdrDatabase.getVocabulary().EnumeratedValueDomain)) {
				vdList.add(new EnumeratedValueDomainImpl(res, mdrDatabase));
			} else {
				vdList.add(new NonEnumeratedValueDomainImpl(res,
						mdrDatabase));
			}

		}
	} finally {
		qexec.close();
	}
	return vdList;
}