本文整理汇总了Java中gov.nih.nci.cagrid.cqlquery.CQLQuery.setTarget方法的典型用法代码示例。如果您正苦于以下问题:Java CQLQuery.setTarget方法的具体用法?Java CQLQuery.setTarget怎么用?Java CQLQuery.setTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.cqlquery.CQLQuery
的用法示例。
在下文中一共展示了CQLQuery.setTarget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formulateCqlQueryWithAssociations
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery formulateCqlQueryWithAssociations() {
CQLQuery cqlQuery = new CQLQuery();
// Set the target object to Protocol.
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName("gov.nih.nci.caarray.domain.protocol.Protocol");
// Set the protocol's "type" association to a Term with a certain value.
Association type = new Association();
type.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
type.setRoleName("type");
Attribute termValue = new Attribute();
termValue.setName("value");
termValue.setValue(DUMMY_TERM_1.getValue());
termValue.setPredicate(Predicate.EQUAL_TO);
type.setAttribute(termValue);
target.setAssociation(type);
// Set the target for the query.
cqlQuery.setTarget(target);
return cqlQuery;
}
示例2: testQueryPqUnit
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryPqUnit() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(PqDataType.class.getName());
Association association1 = new Association();
association1.setName(Pq.class.getName());
association1.setRoleName("value1");
target.setAssociation(association1);
Attribute attribute2 = new Attribute();
attribute2.setName("unit");
attribute2.setPredicate(Predicate.IS_NOT_NULL);
association1.setAttribute(attribute2);
query.setTarget(target);
Iterator<?> iter = executeQuery(query).iterator();
ArrayList<gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType> result = new ArrayList<gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType>();
while (iter.hasNext()) {
result.add((gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType) iter.next());
}
gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType testResultClass = result.get(0);
assertEquals(5, result.size());
assertEquals("GALLON", testResultClass.getValue1().getUnit().toString());
}
示例3: testQueryDsetIiDataTypeAgainstConstant
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryDsetIiDataTypeAgainstConstant() {
CQLQuery query = new CQLQuery();
Object target = new Object();
target.setName(DsetIiDataType.class.getName());
Association a1 = new Association();
a1.setName(DSet.class.getName());
a1.setRoleName("value1");
Association a2 = new Association();
a2.setName(Ii.class.getName());
a2.setRoleName("item");
a2.setAttribute(new Attribute("root", Predicate.EQUAL_TO, "2.16.12.123.456"));
a1.setAssociation(a2);
target.setAssociation(a1);
query.setTarget(target);
executeQuery(query);
}
示例4: testQueryAdDataType
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryAdDataType() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(AdDataType.class.getName());
Association assoc1 = new Association();
assoc1.setName(Ad.class.getName());
assoc1.setRoleName("value1");
Association assoc2 = new Association();
assoc2.setName(Adxp.class.getName());
assoc2.setRoleName("part");
Attribute attrib = new Attribute("value", Predicate.LIKE, "%1");
assoc2.setAttribute(attrib);
assoc1.setAssociation(assoc2);
target.setAssociation(assoc1);
query.setTarget(target);
executeQuery(query);
}
示例5: testQueryIiRootAttribute
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryIiRootAttribute() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(IiDataType.class.getName());
Association association1 = new Association();
association1.setName(Ii.class.getName());
association1.setRoleName("value2");
target.setAssociation(association1);
Attribute attribute2 = new Attribute();
attribute2.setName("root");
attribute2.setPredicate(Predicate.IS_NOT_NULL);
attribute2.setValue("true");
association1.setAttribute(attribute2);
query.setTarget(target);
Iterator<?> iter = executeQuery(query).iterator();
ArrayList<IiDataType> result = new ArrayList<IiDataType>();
while (iter.hasNext()) {
result.add((IiDataType) iter.next());
}
IiDataType testResultClass = result.get(0);
assertEquals(2, result.size());
assertEquals("II_VALUE2_ROOT", testResultClass.getValue2().getRoot().toString());
}
示例6: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery createCqlQuery() {
CQLQuery cqlQuery = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.array.ArrayDesign");
Association providerAssociation = new Association();
providerAssociation.setName("gov.nih.nci.caarray.domain.contact.Organization");
Attribute providerAttribute = new Attribute();
providerAttribute.setName("name");
providerAttribute.setValue(provider);
providerAttribute.setPredicate(Predicate.EQUAL_TO);
providerAssociation.setAttribute(providerAttribute);
providerAssociation.setRoleName("provider");
target.setAssociation(providerAssociation);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例7: testQueryBlNonNullValue
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryBlNonNullValue() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(BlNonNullDataType.class.getName());
Association association1 = new Association();
association1.setName(BlNonNull.class.getName());
association1.setRoleName("value1");
target.setAssociation(association1);
Attribute attribute2 = new Attribute();
attribute2.setName("value");
attribute2.setPredicate(Predicate.EQUAL_TO);
attribute2.setValue("false");
association1.setAttribute(attribute2);
query.setTarget(target);
Iterator<?> iter = executeQuery(query).iterator();
ArrayList<BlNonNullDataType> result = new ArrayList<BlNonNullDataType>();
while (iter.hasNext()) {
result.add((BlNonNullDataType) iter.next());
}
BlNonNullDataType testResultClass = result.get(0);
assertEquals(1, result.size());
assertEquals(testResultClass.getValue1().getValue().booleanValue(), false);
}
示例8: queryForInvalidClass
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private void queryForInvalidClass(EnumerationDataServiceClient client) throws Exception {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName("non.existant.class");
query.setTarget(target);
EnumerationResponseContainer enumContainer = null;
try {
enumContainer = client.enumerationQuery(query);
} catch (QueryProcessingExceptionType ex) {
assertTrue("Query Processing Exception Type thrown", true);
} finally {
if (enumContainer != null && enumContainer.getContext() != null) {
Release release = new Release();
release.setEnumerationContext(enumContainer.getContext());
createDataSource(enumContainer.getEPR()).releaseOp(release);
}
}
}
示例9: retrieveAllSeriesIdentifiers
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
List<String> retrieveAllSeriesIdentifiers() throws ConnectionException {
List<String> imageSeriesIdentifiers = new ArrayList<String>();
final CQLQuery query = new CQLQuery();
Object target = new Object();
target.setName("edu.northwestern.radiology.aim.Series");
query.setTarget(target);
QueryModifier distinctProjectModifier = new QueryModifier();
distinctProjectModifier.setCountOnly(false);
distinctProjectModifier.setDistinctAttribute("instanceUID");
query.setQueryModifier(distinctProjectModifier);
CQLQueryResults result = connectAndExecuteQuery(query);
if (result != null) {
CQLQueryResultsIterator iter2 = new CQLQueryResultsIterator(result);
while (iter2.hasNext()) {
TargetAttribute[] obj = (TargetAttribute[]) iter2.next();
imageSeriesIdentifiers.add(obj[0].getValue());
}
}
return imageSeriesIdentifiers;
}
示例10: testQueryEnDataType
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryEnDataType() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(EnDataType.class.getName());
Association assoc1 = new Association();
assoc1.setName(En.class.getName());
assoc1.setRoleName("value5");
Association assoc2 = new Association();
assoc2.setName(Enxp.class.getName());
assoc2.setRoleName("part");
Attribute attrib = new Attribute("value", Predicate.EQUAL_TO, "Mr. John Doe1");
assoc2.setAttribute(attrib);
assoc1.setAssociation(assoc2);
target.setAssociation(assoc1);
query.setTarget(target);
executeQuery(query);
}
示例11: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery createCqlQuery() {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.publication.Publication");
Association statusAssociation = new Association();
statusAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
Attribute statusAttribute = new Attribute();
statusAttribute.setName("value");
statusAttribute.setValue(publicationStatus);
statusAttribute.setPredicate(Predicate.EQUAL_TO);
statusAssociation.setAttribute(statusAttribute);
statusAssociation.setRoleName("status");
Association typeAssociation = new Association();
typeAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
Attribute typeAttribute = new Attribute();
typeAttribute.setName("value");
typeAttribute.setValue(publicationType);
typeAttribute.setPredicate(Predicate.EQUAL_TO);
typeAssociation.setAttribute(typeAttribute);
typeAssociation.setRoleName("type");
Group associations = new Group();
associations.setAssociation(new Association[] {statusAssociation, typeAssociation});
associations.setLogicRelation(LogicalOperator.AND);
target.setGroup(associations);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例12: loadKeywordsForFile
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private void loadKeywordsForFile(File file) {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName("gov.nih.nci.cananolab.domain.common.Keyword");
Association association = new Association();
association.setName("gov.nih.nci.cananolab.domain.common.File");
association.setRoleName("fileCollection");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(file.getId().toString());
association.setAttribute(attribute);
target.setAssociation(association);
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.common.Keyword");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
file.setKeywordCollection(new HashSet<Keyword>());
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
Keyword keyword = (Keyword) obj;
if (keyword != null) {
System.out.println("Keyword id=" + keyword.getId()
+ "\tName=" + keyword.getName());
builder.append("Keyword id=" + keyword.getId()
+ "\tName=" + keyword.getName() + "\n");
}
file.getKeywordCollection().add(keyword);
}
} catch (Exception e) {
System.out.println("Exception getting keyword for file id="
+ file.getId() + ": " + e);
builder.append("Exception getting keyword for file id="
+ file.getId() + ": " + e + "\n");
}
}
示例13: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery createCqlQuery() {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.hybridization.Hybridization");
Attribute hybridizationNameAttribute = new Attribute();
hybridizationNameAttribute.setName("name");
hybridizationNameAttribute.setValue(hybridizationName);
hybridizationNameAttribute.setPredicate(Predicate.EQUAL_TO);
target.setAttribute(hybridizationNameAttribute);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例14: testQueryCdDataTypeAgainstConstant
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryCdDataTypeAgainstConstant() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(CdDataType.class.getName());
Association assoc = new Association();
assoc.setName(Cd.class.getName());
assoc.setRoleName("value3");
Attribute attrib = new Attribute("codeSystem", Predicate.EQUAL_TO, "CODESYSTEM");
assoc.setAttribute(attrib);
target.setAssociation(assoc);
query.setTarget(target);
executeQuery(query);
}
示例15: testQueryDsetCdEdTextOriginalText
import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryDsetCdEdTextOriginalText() {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(DsetCdDataType.class.getName());
Association association1 = new Association();
association1.setName(DSet.class.getName());
association1.setRoleName("value4");
target.setAssociation(association1);
Association association2 = new Association();
association2.setName(Cd.class.getName());
association2.setRoleName("item");
association1.setAssociation(association2);
Association association3 = new Association();
association3.setName(EdText.class.getName());
association3.setRoleName("originalText");
//association3.setAttribute(new Attribute("value", Predicate.IS_NOT_NULL, "true"));
association2.setAssociation(association3);
query.setTarget(target);
Iterator<?> iter = executeQuery(query).iterator();
ArrayList<DsetCdDataType> result = new ArrayList<DsetCdDataType>();
while (iter.hasNext()) {
result.add((DsetCdDataType)iter.next());
}
DsetCdDataType testResultClass = result.get(0);
assertEquals(5, result.size());
}