

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# SPARQL 主题预测示例
<a name="machine-learning-sparql-inference-subject-prediction"></a>

*主题预测*在给定谓语和对象的情况下预测主题。

例如，以下查询预测谁（类型为 `foaf:User`）将观看给定的电影：

```
SELECT * WHERE { ?input {{(a foaf:Movie)}} .
    SERVICE neptune-ml:inference {
        neptune-ml:config neptune-ml:modelType 'SUBJECT_PREDICTION' ;
                          neptune-ml:input ?input ;
                          neptune-ml:predicate <http://aws.amazon.com/neptune/csv2rdf/object_Property/rated> ;
                          neptune-ml:output ?output ;
                          neptune-ml:outputClass <http://aws.amazon.com/neptune/csv2rdf/class/User> ;        }
}
```