コード例 #1
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getObjectValue
 * Signature: (Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;Luk/ac/manchester/cs/factplusplus/IndividualPointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getObjectValue
  (JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
	TRACE_JNI("getObjectValue");
	TJNICache* J = getJ(env,obj);
	return J->Class ( J->EM->Value ( getORoleExpr(env,arg1), getIndividualExpr(env,arg2) ) );
}
コード例 #2
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getTopObjectProperty
 * Signature: ()Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getTopObjectProperty
  (JNIEnv * env, jobject obj)
{
	TRACE_JNI("getTopObjectProperty");
	TJNICache* J = getJ(env,obj);
	return J->ObjectProperty(J->getOName("http://www.w3.org/2002/07/owl#topObjectProperty"));
}
コード例 #3
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getInverseProperty
 * Signature: (Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;)Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getInverseProperty
  (JNIEnv * env, jobject obj, jobject arg)
{
	TRACE_JNI("getInverseProperty");
	TJNICache* J = getJ(env,obj);
	return J->ObjectProperty(J->EM->Inverse(getORoleExpr(env,arg)));
}
コード例 #4
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getOneOf
 * Signature: ()Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getOneOf
  (JNIEnv * env, jobject obj)
{
	TRACE_JNI("getOneOf");
	TJNICache* J = getJ(env,obj);
	return J->Class(J->EM->OneOf());
}
コード例 #5
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataAtMost
 * Signature: (ILuk/ac/manchester/cs/factplusplus/DataPropertyPointer;Luk/ac/manchester/cs/factplusplus/DataTypePointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataAtMost
  (JNIEnv * env, jobject obj, jint n, jobject arg1, jobject arg2)
{
	TRACE_JNI("getDataAtMost");
	TJNICache* J = getJ(env,obj);
	return J->Class ( J->EM->MaxCardinality ( n, getDRoleExpr(env,arg1), getDataExpr(env,arg2) ) );
}
コード例 #6
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getRestrictedDataType
 * Signature: (Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;Luk/ac/manchester/cs/factplusplus/DataTypeFacet;)Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getRestrictedDataType
  (JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
	TRACE_JNI("getRestrictedDataType");
	TJNICache* J = getJ(env,obj);
	return J->DataTypeExpression ( J->EM->RestrictedType ( getDataTypeExpr(env,arg1), getFacetExpr(env,arg2) ) );
}
コード例 #7
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataValue
 * Signature: (Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;Luk/ac/manchester/cs/factplusplus/DataValuePointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataValue__Luk_ac_manchester_cs_factplusplus_DataPropertyPointer_2Luk_ac_manchester_cs_factplusplus_DataValuePointer_2
  (JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
	TRACE_JNI("getDataValue");
	TJNICache* J = getJ(env,obj);
	return J->Class ( J->EM->Value ( getDRoleExpr(env,arg1), getDataValueExpr(env,arg2) ) );
}
コード例 #8
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getObjectSome
 * Signature: (Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;Luk/ac/manchester/cs/factplusplus/ClassPointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getObjectSome
  (JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
	TRACE_JNI("getObjectSome");
	TJNICache* J = getJ(env,obj);
	return J->Class ( J->EM->Exists ( getORoleExpr(env,arg1), getConceptExpr(env,arg2) ) );
}
コード例 #9
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getSelf
 * Signature: (Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getSelf
  (JNIEnv * env, jobject obj, jobject arg)
{
	TRACE_JNI("getSelf");
	TJNICache* J = getJ(env,obj);
	return J->Class(J->EM->SelfReference(getORoleExpr(env,arg)));
}
コード例 #10
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getConceptNot
 * Signature: (Luk/ac/manchester/cs/factplusplus/ClassPointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getConceptNot
  (JNIEnv * env, jobject obj, jobject arg)
{
	TRACE_JNI("getConceptNot");
	TJNICache* J = getJ(env,obj);
	return J->Class(J->EM->Not(getConceptExpr(env,arg)));
}
コード例 #11
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataUnionOf
 * Signature: ()Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataUnionOf
  (JNIEnv * env, jobject obj)
{
	TRACE_JNI("getDataUnionOf");
	TJNICache* J = getJ(env,obj);
	return J->DataTypeExpression(J->EM->DataOr());
}
コード例 #12
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataNot
 * Signature: (Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;)Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataNot
  (JNIEnv * env, jobject obj, jobject arg)
{
	TRACE_JNI("getDataNot");
	TJNICache* J = getJ(env,obj);
	return J->DataTypeExpression(J->EM->DataNot(getDataExpr(env,arg)));
}
コード例 #13
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getMaxInclusiveFacet
 * Signature: (Luk/ac/manchester/cs/factplusplus/DataValuePointer;)Luk/ac/manchester/cs/factplusplus/DataTypeFacet;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getMaxInclusiveFacet
  (JNIEnv * env, jobject obj, jobject arg)
{
	TRACE_JNI("getMaxInclusiveFacet");
	TJNICache* J = getJ(env,obj);
	return J->Facet(J->EM->FacetMaxInclusive(getDataValueExpr(env,arg)));
}
コード例 #14
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getPropertyComposition
 * Signature: ()Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getPropertyComposition
  (JNIEnv * env, jobject obj)
{
	TRACE_JNI("getPropertyComposition");
	TJNICache* J = getJ(env,obj);
	return J->ObjectComplex(J->EM->Compose());
}
コード例 #15
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataAll
 * Signature: (Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;Luk/ac/manchester/cs/factplusplus/DataTypeExpressionPointer;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataAll
  (JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
	TRACE_JNI("getDataAll");
	TJNICache* J = getJ(env,obj);
	return J->Class ( J->EM->Forall ( getDRoleExpr(env,arg1), getDataExpr(env,arg2) ) );
}
コード例 #16
0
ファイル: Queries.cpp プロジェクト: ethz-asl/libfactplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    askDataProperties
 * Signature: (Luk/ac/manchester/cs/factplusplus/IndividualPointer;)[Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;
 */
JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askDataProperties
(JNIEnv * env, jobject obj, jobject arg)
{
    TRACE_JNI("askDataProperties");
    TRACE_ARG(env,obj,arg);
    TJNICache* J = getJ(env,obj);
    ReasoningKernel::NamesVector Rs;
    PROCESS_QUERY ( J->K->getRelatedRoles ( getROIndividualExpr(env,arg), Rs, /*data=*/true, /*needI=*/false ) );
    std::vector<TExpr*> acc;
    for ( ReasoningKernel::NamesVector::const_iterator p = Rs.begin(), p_end = Rs.end(); p < p_end; ++p )
        acc.push_back(J->getDName((*p)->getName()));
    return J->buildArray ( acc, J->DataPropertyPointer );
}
コード例 #17
0
ファイル: Queries.cpp プロジェクト: ethz-asl/libfactplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    askRelatedIndividuals
 * Signature: (Luk/ac/manchester/cs/factplusplus/IndividualPointer;Luk/ac/manchester/cs/factplusplus/ObjectPropertyPointer;)[Luk/ac/manchester/cs/factplusplus/IndividualPointer;
 */
JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askRelatedIndividuals
(JNIEnv * env, jobject obj, jobject arg1, jobject arg2)
{
    TRACE_JNI("askRelatedIndividuals");
    TRACE_ARG(env,obj,arg1);
    TRACE_ARG(env,obj,arg2);
    TJNICache* J = getJ(env,obj);
    ReasoningKernel::NamesVector Js;
    PROCESS_QUERY ( J->K->getRoleFillers ( getROIndividualExpr(env,arg1), getROORoleExpr(env,arg2), Js ) );
    std::vector<TExpr*> acc;
    for ( ReasoningKernel::NamesVector::const_iterator p = Js.begin(), p_end = Js.end(); p < p_end; ++p )
        acc.push_back(J->getIName((*p)->getName()));
    return J->buildArray ( acc, J->IndividualPointer );
}
コード例 #18
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getDataValue
 * Signature: (Ljava/lang/String;Luk/ac/manchester/cs/factplusplus/DataTypePointer;)Luk/ac/manchester/cs/factplusplus/DataValuePointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getDataValue__Ljava_lang_String_2Luk_ac_manchester_cs_factplusplus_DataTypePointer_2
  (JNIEnv * env, jobject obj, jstring str, jobject type)
{
	TRACE_JNI("getDataValue");
	TRACE_STR(env,str);
	TJNICache* J = getJ(env,obj);
	JString name(env,str);
	jobject ret = (jobject)0;
	try
	{
		ret = J->DataValue ( J->EM->DataValue ( name(), getDataTypeExpr(env,type) ) );
	}
	catch (const EFPPCantRegName&)
	{
		Throw ( env, "FaCT++ Kernel: Can not register new data value" );
	}
	return ret;
}
コード例 #19
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getNamedClass
 * Signature: (Ljava/lang/String;)Luk/ac/manchester/cs/factplusplus/ClassPointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getNamedClass
  (JNIEnv * env, jobject obj, jstring str)
{
	TRACE_JNI("getNamedClass");
	TRACE_STR(env,str);
	TJNICache* J = getJ(env,obj);
	JString name(env,str);
	jobject ret = (jobject)0;
	try
	{
		ret = J->Class(J->getCName(name()));
	}
	catch (const EFPPCantRegName&)
	{
		Throw ( env, "FaCT++ Kernel: Can not register new class name" );
	}
	return ret;
}
コード例 #20
0
ファイル: Expressions.cpp プロジェクト: dgu123/factplusplus
/*
 * Class:     uk_ac_manchester_cs_factplusplus_FaCTPlusPlus
 * Method:    getBuiltInDataType
 * Signature: (Ljava/lang/String;)Luk/ac/manchester/cs/factplusplus/DataTypePointer;
 */
JNIEXPORT jobject JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_getBuiltInDataType
  (JNIEnv * env, jobject obj, jstring str)
{
	TRACE_JNI("getBuiltInDataType");
	TRACE_STR(env,str);
	TJNICache* J = getJ(env,obj);
	JString name(env,str);
	std::string DTName(name());
	if ( DTName == "http://www.w3.org/2000/01/rdf-schema#Literal" ||
		 DTName == "http://www.w3.org/2000/01/rdf-schema#anySimpleType" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#anyType" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#anySimpleType" )
		return J->DataType(J->EM->DataTop());

	if ( DTName == "http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral" ||
		 DTName == "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#string" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#anyURI" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#ID" )
		return J->DataType(J->EM->getStrDataType());

	if ( DTName == "http://www.w3.org/2001/XMLSchema#integer" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#int" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#long" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#positiveInteger" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#negativeInteger" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#short" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#byte" )
		return J->DataType(J->EM->getIntDataType());

	if ( DTName == "http://www.w3.org/2001/XMLSchema#float" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#double" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#real" ||
		 DTName == "http://www.w3.org/2001/XMLSchema#decimal" )
		return J->DataType(J->EM->getRealDataType());

	if ( DTName == "http://www.w3.org/2001/XMLSchema#boolean" )
		return J->DataType(J->EM->getBoolDataType());

	if ( DTName == "http://www.w3.org/2001/XMLSchema#dateTimeAsLong" )
		return J->DataType(J->EM->getTimeDataType());

	std::stringstream err;
	err << "Unsupported datatype '" << DTName.c_str() << "'";
	Throw ( env, err.str().c_str() );
	return (jobject)0;
}